/* ==========================================================================
   BookMe — interface d'administration
   ========================================================================== */

:root {
    --bg: #f4f5fa;
    --surface: #ffffff;
    --ink: #0f1226;
    --ink-2: #3b4058;
    --muted: #6b7088;
    --line: #e7e9f2;
    --line-strong: #d5d8e6;

    --accent: #5b5bd6;
    --accent-strong: #4a49c4;
    --accent-soft: #eeeeff;
    --accent-ink: #3a39a8;

    --success: #0f9d6b;
    --success-soft: #e3f7ee;
    --danger: #d63b4a;
    --danger-soft: #fdecee;
    --warn-soft: #fff4dc;

    --sidebar: #0f1226;
    --sidebar-line: rgba(255, 255, 255, .08);

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(15, 18, 38, .04), 0 8px 24px -12px rgba(15, 18, 38, .12);
    --shadow-lg: 0 24px 60px -20px rgba(15, 18, 38, .35);

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 15px/1.55 var(--font);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.icon {
    width: 18px; height: 18px; flex: none;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    padding: 20px 14px;
    background: var(--sidebar); color: #c5c9e0;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 6px 10px 22px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, #7c7cf0, #5b5bd6 55%, #3f8cf0);
    box-shadow: 0 6px 16px -4px rgba(91, 91, 214, .7);
}
.brand-mark .icon { width: 18px; height: 18px; color: #fff; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 14px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6f7494; }
.nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px;
    color: #b6bad3; font-weight: 500;
    transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.nav a.is-active { background: rgba(124, 124, 240, .18); color: #fff; }
.nav a.is-active .icon { color: #a5a5ff; }

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--sidebar-line); }
.me { display: flex; align-items: center; gap: 11px; padding: 8px 10px; }
.me-name { color: #fff; font-weight: 600; font-size: 14px; line-height: 1.2; }
.me-role { font-size: 12px; color: #7f84a3; }
.logout-form { margin-top: 6px; }
.logout-btn {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: none; border: 0; border-radius: 10px; color: #b6bad3; cursor: pointer; text-align: left; font-weight: 500;
}
.logout-btn:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.main { min-width: 0; }
.topbar { display: none; }
.content { max-width: 1080px; margin: 0 auto; padding: 36px 40px 64px; }

/* ---------- En-tête de page ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: none; }
.crumbs .icon { width: 14px; height: 14px; opacity: .6; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.page-head .sub { margin-top: 6px; color: var(--muted); max-width: 60ch; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
    font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: #f8f9fd; border-color: #c4c8dc; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .switch input:focus-visible + .switch-track, .choice input:focus-visible + .choice-body {
    outline: 3px solid rgba(91, 91, 214, .35); outline-offset: 2px;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 6px 16px -8px rgba(91, 91, 214, .9); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-danger { color: var(--danger); border-color: #f2c4ca; background: #fff; }
.btn-danger:hover { background: var(--danger-soft); border-color: #eba5ae; }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #bd2f3d; border-color: #bd2f3d; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: rgba(15, 18, 38, .05); border-color: transparent; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-icon { padding: 8px; border-radius: 9px; }
.btn .icon { width: 16px; height: 16px; }
form.inline { display: inline; margin: 0; }

/* ---------- Cartes ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-pad { padding: 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h2 { font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.card-head .count { color: var(--muted); font-weight: 500; margin-left: 6px; }
.stack { display: grid; gap: 20px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat { padding: 20px; display: grid; gap: 14px; }
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.stat-icon.is-green { background: var(--success-soft); color: var(--success); }
.stat-icon.is-amber { background: var(--warn-soft); color: #c98200; }
.stat-icon.is-pink { background: #ffe9f3; color: #d6336c; }
.stat-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.stat-label { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th {
    text-align: left; padding: 12px 16px; font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); background: #fafbfe; border-bottom: 1px solid var(--line);
}
.table td { padding: 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.table .nowrap { white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fbfbfe; }
.table .num { text-align: right; }
.table .row-actions { text-align: right; white-space: nowrap; }
.cell-main { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cell-title { font-weight: 600; color: var(--ink); }
.cell-title:hover { color: var(--accent-ink); text-decoration: none; }
.cell-sub { color: var(--muted); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.swatches { display: inline-flex; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-strong); }
.swatch + .swatch { margin-left: -6px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: #eef0f6; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge-success { background: var(--success-soft); color: #0b7a53; }
.badge-muted { background: #eef0f6; color: #6b7088; }
.badge-accent { background: var(--accent-soft); color: var(--accent-ink); }
.badge-plain::before { display: none; }

/* ---------- Avatars ---------- */
.avatar {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    display: inline-grid; place-items: center; object-fit: cover;
    color: #fff; font-weight: 700; font-size: 16px;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--line);
}
.avatar--sm { width: 30px; height: 30px; font-size: 13px; }
.avatar--lg { width: 72px; height: 72px; font-size: 28px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: -10px; }

/* ---------- Formulaires ---------- */
.form-card { max-width: 760px; }
.form-section { padding: 26px 28px; border-bottom: 1px solid var(--line); }
.form-section:last-of-type { border-bottom: 0; }
.form-section > h2 { font-size: 15px; font-weight: 650; margin-bottom: 4px; }
.form-section > .section-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 28px; background: #fafbfe; border-top: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); }

.field { display: grid; gap: 6px; align-content: start; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.optional { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 4px; }
.hint { font-size: 12.5px; color: var(--muted); }
.error-text { font-size: 12.5px; color: var(--danger); font-weight: 500; }
.input {
    width: 100%; padding: 10px 13px; background: #fff;
    border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
    transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #bfc4d9; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(91, 91, 214, .15); }
.field--error .input { border-color: var(--danger); background: #fffafa; }
textarea.input { resize: vertical; min-height: 80px; }
select.input { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%236b7088' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m1 1.5 5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
.input-group { display: flex; }
.input-group .input { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.input-suffix { display: inline-flex; align-items: center; padding: 0 13px; background: #f4f5fa; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--muted); font-size: 13.5px; white-space: nowrap; }

.slug-preview { display: flex; align-items: stretch; }
.slug-preview .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); text-align: right; font-weight: 600; }

/* Interrupteur */
.switch { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track { position: relative; width: 44px; height: 26px; flex: none; border-radius: 999px; background: #cfd3e4; transition: background .2s; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch-text strong { display: block; font-weight: 600; }
.switch-text span { display: block; font-size: 13px; color: var(--muted); }

/* Cartes de choix (radio / checkbox) */
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body { display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; transition: border-color .15s, background .15s, box-shadow .15s; }
.choice:hover .choice-body { border-color: #b7bbd6; }
.choice input:checked + .choice-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(91, 91, 214, .12); }
.choice-tick { width: 20px; height: 20px; flex: none; margin-top: 1px; border-radius: 50%; border: 1.5px solid #b9bdd3; display: grid; place-items: center; color: transparent; background: #fff; }
.choice input:checked + .choice-body .choice-tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.choice-tick .icon { width: 12px; height: 12px; stroke-width: 3; }
.choice-title { font-weight: 600; line-height: 1.3; }
.choice-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.choices--list { grid-template-columns: 1fr; gap: 8px; }
.choices--list .choice-body { align-items: center; padding: 11px 14px; }
.choices--list .choice-tick { border-radius: 6px; margin-top: 0; }
/* Liste réordonnable (prestations d'un collaborateur) : poignée, flèches, ligne en cours de déplacement */
.sort-row { display: flex; align-items: center; gap: 6px; }
.sort-row .choice { flex: 1; min-width: 0; }
.drag-handle { flex: none; display: grid; place-items: center; width: 28px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: grab; touch-action: none; }
.drag-handle:hover { background: var(--field, #eef0f8); color: var(--ink, #12141f); }
.drag-handle:active { cursor: grabbing; }
.drag-handle .icon { width: 18px; height: 18px; }
.sort-arrows { flex: none; display: flex; flex-direction: column; gap: 2px; }
.drag-btn { display: grid; place-items: center; width: 26px; height: 18px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; color: var(--muted); cursor: pointer; }
.drag-btn:hover { color: var(--accent); border-color: var(--accent); }
.drag-btn .icon { width: 12px; height: 12px; stroke-width: 2.4; }
[data-sortable-item].is-dragging { opacity: .45; }
[data-sortable-item].is-moved .choice-body { animation: moved .6s ease; }
@keyframes moved { from { box-shadow: 0 0 0 4px rgba(91, 91, 214, .35); } to { box-shadow: 0 0 0 0 rgba(91, 91, 214, 0); } }
.choice-trail { margin-left: auto; color: var(--muted); font-size: 13px; white-space: nowrap; }
.choice-body .avatar { margin: -2px 0; }

/* Sélecteur de couleur */
.color-field { display: flex; align-items: center; gap: 12px; padding: 6px 12px 6px 6px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; width: fit-content; min-width: 180px; }
.color-field input[type="color"] { width: 38px; height: 38px; padding: 0; border: 0; border-radius: 8px; background: none; cursor: pointer; }
.color-field input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-field input[type="color"]::-webkit-color-swatch { border: 1px solid rgba(0, 0, 0, .1); border-radius: 8px; }
.color-field input[type="color"]::-moz-color-swatch { border: 1px solid rgba(0, 0, 0, .1); border-radius: 8px; }
.color-hex { font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); text-transform: uppercase; }

/* Photo */
.photo-field { display: flex; align-items: center; gap: 18px; }
.photo-field .actions { gap: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.check-inline input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Options de prestation */
.option-rows { display: grid; gap: 10px; }
.option-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 130px 40px; gap: 10px; align-items: center; }
.option-head { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.option-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 13.5px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-sm); }

/* ---------- Alertes ---------- */
.flashes { display: grid; gap: 10px; margin-bottom: 24px; }
.flash { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: var(--radius-sm); border: 1px solid; font-weight: 500; animation: pop .25s ease-out; }
.flash-success { background: var(--success-soft); border-color: #b4e6d0; color: #0b6b49; }
.flash-error { background: var(--danger-soft); border-color: #f4c3c9; color: #a52a37; }
.flash-info { background: var(--accent-soft); border-color: #cfd0f7; color: var(--accent-ink); }
.flash .icon { width: 20px; height: 20px; }
.flash-close { margin-left: auto; background: none; border: 0; cursor: pointer; color: inherit; opacity: .6; padding: 2px; display: grid; }
.flash-close:hover { opacity: 1; }
.form-alert { margin: 20px 28px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); color: #a52a37; border: 1px solid #f4c3c9; font-weight: 500; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- États vides ---------- */
.empty { display: grid; justify-items: center; gap: 6px; padding: 56px 24px; text-align: center; }
.empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 10px; }
.empty-icon .icon { width: 26px; height: 26px; }
.empty h2 { font-size: 18px; }
.empty p { color: var(--muted); max-width: 44ch; margin-bottom: 14px; }

/* ---------- Fiche boutique ---------- */
.shop-hero { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 20px; overflow: hidden; position: relative; }
.shop-hero::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, var(--c1), var(--c2)); }
.shop-logo { width: 60px; height: 60px; border-radius: 16px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 24px; background: linear-gradient(135deg, var(--c1), var(--c2)); flex: none; }
.shop-hero h2 { font-size: 20px; letter-spacing: -.01em; }
.shop-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 8px; color: var(--muted); font-size: 13.5px; }
.shop-meta span { display: inline-flex; align-items: center; gap: 6px; }
.shop-meta .icon { width: 15px; height: 15px; }
.link-box { display: flex; align-items: center; gap: 10px; margin-top: 6px; padding: 10px 12px; border-radius: var(--radius-sm); background: #f4f5fa; border: 1px solid var(--line); }
.link-box code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 22px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .grow .cell-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .badge { flex: none; }
.list .trail { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.roadmap { display: grid; gap: 10px; padding: 18px 22px 22px; color: var(--muted); font-size: 13.5px; }
.roadmap li { list-style: none; display: flex; gap: 10px; align-items: center; }
.roadmap .dot { width: 8px; height: 8px; border-radius: 50%; background: #cfd3e4; flex: none; }
.danger-zone { border-color: #f2d3d7; }

/* ---------- Dialogue de confirmation ---------- */
dialog.confirm { border: 0; border-radius: 18px; padding: 0; width: min(420px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(15, 18, 38, .5); backdrop-filter: blur(3px); }
.confirm-body { padding: 26px 26px 20px; }
.confirm-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); margin-bottom: 14px; }
.confirm-body h2 { font-size: 18px; margin-bottom: 6px; }
.confirm-body p { color: var(--muted); }
.confirm-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 26px 22px; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.auth-aside {
    position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
    padding: 44px 52px; color: #fff;
    background: radial-gradient(1200px 600px at 0% 0%, #7c7cf0 0%, transparent 60%), radial-gradient(900px 600px at 100% 100%, #2f7ff0 0%, transparent 55%), #14163a;
}
.auth-aside .brand { padding: 0; font-size: 19px; }
.auth-aside h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.03em; max-width: 14ch; }
.auth-aside p { margin-top: 16px; color: rgba(255, 255, 255, .78); max-width: 40ch; font-size: 16px; }
.auth-points { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.auth-points li { display: flex; gap: 12px; align-items: center; color: rgba(255, 255, 255, .85); }
.auth-points .icon { width: 20px; height: 20px; padding: 4px; box-sizing: content-box; border-radius: 8px; background: rgba(255, 255, 255, .14); }
.auth-main { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 26px; letter-spacing: -.02em; }
.auth-card .sub { color: var(--muted); margin: 6px 0 26px; }
.auth-card form { display: grid; gap: 18px; }
.auth-card .btn { width: 100%; padding: 12px; font-size: 15px; }

/* ---------- Erreurs ---------- */
.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; text-align: center; background: var(--bg); }
.error-code { font-size: 84px; font-weight: 800; letter-spacing: -.05em; line-height: 1; background: linear-gradient(135deg, #7c7cf0, #3f8cf0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h1 { font-size: 24px; margin: 10px 0 8px; }
.error-page p { color: var(--muted); margin-bottom: 22px; }
.error-page pre { text-align: left; max-width: 760px; overflow: auto; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 12px; margin: 0 auto 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    .app { display: block; }
    .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; padding: 10px 16px; background: var(--sidebar); color: #fff; }
    .topbar .brand { padding: 0; font-size: 16px; }
    .topbar .brand-mark { width: 30px; height: 30px; }
    .menu-btn { background: rgba(255, 255, 255, .08); border: 0; color: #fff; border-radius: 10px; padding: 8px; cursor: pointer; display: grid; }
    .sidebar { position: fixed; z-index: 30; inset: 0 auto 0 0; width: 276px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: none; }
    .scrim { position: fixed; inset: 0; z-index: 25; background: rgba(15, 18, 38, .5); }
    .content { padding: 22px 16px 56px; }
    .page-head h1 { font-size: 24px; }
    .form-grid, .choices { grid-template-columns: 1fr; }
    .option-row { grid-template-columns: minmax(0, 1fr) 1fr 40px; }
    .option-row .opt-name { grid-column: 1 / -1; }
    .option-head { display: none; }
    .option-row .opt-del { grid-column: 3; grid-row: 2; }
    .auth { grid-template-columns: 1fr; }
    .auth-aside { display: none; }
    .table th, .table td { padding-left: 16px; padding-right: 16px; }
    .form-section { padding: 22px 18px; }
    .form-foot { padding: 16px 18px; }
    .hide-sm { display: none; }
}
@media (max-width: 520px) {
    .stats { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat { padding: 16px; }
    .stat-value { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* ---------- Disponibilités ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: #eef0f7; border-radius: 11px; width: fit-content; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; color: #4a4f68; }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg input:focus-visible + span { outline: 3px solid rgba(91, 91, 214, .35); }
.flash-warning { background: var(--warn-soft); border-color: #f1d99b; color: #8a5a00; }

/* ---------- Personnalisation de la page de réservation ---------- */
.content--wide { max-width: none; padding-left: 32px; padding-right: 32px; }
.appearance { display: grid; grid-template-columns: minmax(340px, 430px) minmax(0, 1fr); gap: 24px; align-items: start; }
.appearance-form { overflow: hidden; }
.ap-section { border-bottom: 1px solid var(--line); }
.ap-section summary { list-style: none; cursor: pointer; padding: 16px 22px; font-weight: 650; display: flex; justify-content: space-between; align-items: center; }
.ap-section summary::-webkit-details-marker { display: none; }
.ap-section summary::after { content: "+"; color: var(--muted); font-size: 20px; font-weight: 400; }
.ap-section[open] summary::after { content: "–"; }
.ap-body { padding: 0 22px 20px; display: grid; gap: 16px; }
.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ap-body input[type="range"] { width: 100%; accent-color: var(--accent); }
.range-val { float: right; font: 12px var(--mono); color: var(--muted); font-weight: 400; }
.hint-inline { color: var(--muted); font-weight: 400; font-size: 12.5px; }
.logo-row { display: flex; align-items: center; gap: 16px; }
.logo-current { width: 120px; height: 72px; flex: none; display: grid; place-items: center; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: repeating-conic-gradient(#f1f2f8 0% 25%, #fff 0% 50%) 50% / 14px 14px; overflow: hidden; color: var(--muted); font-size: 12.5px; }
.logo-current img { max-width: 100%; max-height: 100%; object-fit: contain; }
.presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.presets button { border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 8px 4px 6px; cursor: pointer; font-size: 12px; font-weight: 600; display: grid; gap: 5px; justify-items: center; }
.presets button:hover { border-color: #a9acd6; }
.presets i { display: block; width: 100%; height: 22px; border-radius: 6px; border: 1px solid rgba(0, 0, 0, .08); }
.fontgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 300px; overflow: auto; padding: 2px; }
.fontopt { position: relative; cursor: pointer; }
.fontopt input { position: absolute; opacity: 0; pointer-events: none; }
.fontopt span { display: block; border: 1.5px solid var(--line); background: #fff; border-radius: 11px; padding: 9px 11px; line-height: 1.2; transition: border-color .15s, background .15s; }
.fontopt:hover span { border-color: #b7bbd6; }
.fontopt input:checked + span { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(91, 91, 214, .15); }
.fontopt input:focus-visible + span { outline: 3px solid rgba(91, 91, 214, .35); outline-offset: 2px; }
.fontopt b { display: block; font-size: 18px; font-weight: 600; }
.fontopt i { font-style: normal; font-size: 11px; color: var(--muted); }
.appearance-foot { position: sticky; bottom: 0; justify-content: space-between; }

.preview { position: sticky; top: 20px; display: grid; gap: 12px; }
.preview-bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.preview-stage { position: relative; height: calc(100vh - 150px); min-height: 520px; display: grid; place-items: center; background: #e6e8f2; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.scaler { position: relative; }
.frame { position: absolute; left: 0; top: 0; transform-origin: top left; background: #fff; overflow: hidden; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.frame.is-mobile { border-radius: 34px; box-shadow: 0 0 0 9px #14161f, 0 24px 60px -20px rgba(15, 18, 38, .5); }
.frame.is-desktop { border-radius: 10px; box-shadow: 0 0 0 1px #cfd3e3, 0 24px 60px -20px rgba(15, 18, 38, .35); }
.preview-fail { position: absolute; inset: auto 16px 16px; padding: 12px 14px; border-radius: 10px; background: var(--warn-soft); color: #8a5a00; font-size: 13.5px; }
@media (max-width: 1100px) {
    .appearance { grid-template-columns: 1fr; }
    .preview { position: static; }
    .preview-stage { height: 640px; }
    .content--wide { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Filtres ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.seg-link { display: block; padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13px; color: #4a4f68; }
.seg-link:hover { text-decoration: none; color: var(--ink); }
.seg-link.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.filter-shop select { width: auto; min-width: 220px; }
.filter-shop { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.combo { position: relative; }
.combo > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); pointer-events: none; }
.combo .input { width: 280px; max-width: 100%; padding-left: 36px; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.photo-current { width: 150px; height: 96px; }
.photo-current img { width: 100%; height: 100%; object-fit: cover; max-width: none; max-height: none; }

/* Une colonne de cartes ne doit jamais être élargie par un contenu long (lien, adresse). */
.stack { grid-template-columns: minmax(0, 1fr); }
.stack > * { min-width: 0; }
.link-box code { min-width: 0; }
.list .grow .cell-sub.wrap { white-space: normal; overflow: visible; text-overflow: clip; }

.perm-list { display: grid; gap: 16px; }

/* Saisie d'un texte dans plusieurs langues */
.lang-input { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.lang-input:first-of-type { margin-top: 0; }
.lang-input .input { flex: 1; min-width: 0; }
.lang-tag { flex: none; min-width: 34px; text-align: center; padding: 5px 7px; border-radius: 8px; background: var(--accent-soft, #eef0ff); color: var(--accent-ink, #3b4acb); font-size: 11px; font-weight: 700; letter-spacing: .05em; }
.lang-input--error .input { border-color: var(--danger, #d4533f); }

.lang-block { display: grid; gap: 4px; margin-top: -6px; }
.option-row--multi { align-items: start; }
.option-row .opt-name { display: grid; gap: 6px; min-width: 0; }
.option-row .opt-name .lang-input { margin-top: 0; }

/* Horaires habituels : une ligne par jour, deux plages */
.week-rows { display: grid; gap: 8px; }
.wk-row { display: grid; grid-template-columns: 150px auto 1fr; align-items: center; gap: 8px 14px; padding: 8px 12px; border: 1.5px solid var(--line, #e4e6ef); border-radius: 12px; }
.wk-row--error { border-color: var(--danger, #d4533f); }
.wk-day { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; }
.wk-day input { position: absolute; opacity: 0; pointer-events: none; }
.wk-box { width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--line-strong, #c5c9d8); display: grid; place-items: center; color: transparent; flex: none; }
.wk-box .icon { width: 14px; height: 14px; }
.wk-on:checked + .wk-box { background: var(--accent, #3b5bfd); border-color: var(--accent, #3b5bfd); color: #fff; }
.wk-on:focus-visible + .wk-box { outline: 2px solid var(--accent, #3b5bfd); outline-offset: 2px; }
.wk-times { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.wk-range { display: inline-flex; align-items: center; gap: 6px; }
fieldset.bare { border: 0; margin: 0; padding: 0; min-width: 0; }   /* groupe de champs sans cadre (désactivé en consultation seule) */
.wk-range .input { width: 128px; padding: 8px 10px; }
.wk-off { display: none; color: var(--muted); font-size: 13px; }
.wk-row:has(.wk-on:not(:checked)) .wk-times { opacity: .35; pointer-events: none; }
.wk-row:has(.wk-on:not(:checked)) .wk-off { display: inline; }
.wk-error { grid-column: 1 / -1; margin: 0; }
.wk-tools { margin-top: 12px; }
@media (max-width: 640px) {
    .wk-row { grid-template-columns: 1fr auto; }
    .wk-times { grid-column: 1 / -1; grid-row: 2; }
}

.sub-h { margin: 24px 0 4px; font-size: 14.5px; }

/* WhatsApp : état, simulateur */
.status-grid { display: grid; grid-template-columns: 190px 1fr; gap: 10px 16px; margin: 0 0 12px; }
.status-grid dt { color: var(--muted); font-size: 13.5px; }
.status-grid dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.tpl-block { margin-top: 6px; }
.sim { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.sim-thread { display: grid; gap: 8px; max-height: 420px; overflow-y: auto; padding: 14px; border-radius: 14px; background: #ece5dd; align-content: start; min-height: 220px; }
.sim-msg { display: grid; gap: 2px; max-width: 86%; padding: 8px 12px; border-radius: 12px; font-size: 14px; background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.sim-msg small { font-size: 11px; color: #8a8f9c; }
.sim-msg--out { margin-left: auto; background: #d9fdd3; }
.sim-form { display: grid; gap: 12px; }
@media (max-width: 800px) { .sim { grid-template-columns: 1fr; } .status-grid { grid-template-columns: 1fr; } }

.switch.is-disabled { opacity: .5; }
.switch.is-disabled .switch-track { cursor: not-allowed; }

/* lignes et cartes entières cliquables */
.row-link { cursor: pointer; }
.list li.row-link:hover { background: #fbfbfe; }

/* photo en portrait d'un collaborateur (fiche collaborateur) */
.portrait-thumb { width: 54px; height: 96px; flex: none; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: var(--line); color: var(--muted); font-size: 12px; }
.portrait-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge-failed { background: #fde8e8; color: #b42318; }

.nav-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; text-align: center; line-height: 20px; }
.conflict .card-head { align-items: flex-start; }

/* choix d'une boutique avant d'afficher une liste */
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.picker-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-decoration: none; color: inherit; transition: border-color .15s, transform .05s; }
.picker-card:hover { text-decoration: none; border-color: var(--accent); }
.picker-card:active { transform: translateY(1px); }
.picker-card .grow { flex: 1; min-width: 0; }

/* Prestation « hors horaires » : plages communes et plages propres à chaque collaborateur */
.sub-title { margin: 0 0 6px; font-size: 14px; font-weight: 700; }
.own-hours-item { padding: 14px 16px; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; }
