/* Claudine — Gestion du cabinet
   Identité : logo « esprit démêlé » — bleu ardoise #5991A7 + orange #F2622B
   Typo : Lora (titres) + Raleway (texte) · mobile-first · accessible (AA) */

:root {
    --blue: #5991A7;
    --blue-deep: #3D6E82;
    --blue-ink: #1F3A47;
    --orange: #F2622B;
    --orange-soft: #FDEDE5;
    --paper: #F6F8F9;
    --card: #FFFFFF;
    --line: #D9E3E8;
    --muted: #5A7482;
    --green: #1E7B4F;
    --green-soft: #E4F3EB;
    --red: #B3362B;
    --red-soft: #FBEAE8;
    --gold: #8A6D1A;
    --gold-soft: #FBF3D9;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(31, 58, 71, .08), 0 4px 14px rgba(31, 58, 71, .06);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Raleway', system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--blue-ink);
    background: var(--paper);
}

h1, h2, h3, .doc-title { font-family: 'Lora', Georgia, serif; }

a { color: var(--blue-deep); }

/* ---------------------------------------------------------------- topbar */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    background: var(--blue);
    color: #fff;
    box-shadow: var(--shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #fff;
    text-decoration: none;
    font-family: 'Lora', serif;
    font-weight: 600;
    font-size: 17px;
    min-width: 0;
}

.brand img { border-radius: 7px; display: block; }

.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav { display: flex; gap: 4px; }

.nav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 11px;
    min-height: 44px;
    border-radius: 9px;
    color: #EAF3F7;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: background .2s;
}

.nav a:hover { background: rgba(255, 255, 255, .14); }

.nav a.active { background: rgba(255, 255, 255, .22); color: #fff; }

@media (max-width: 640px) {
    .brand span { display: none; }
    .nav { flex: 1; min-width: 0; justify-content: space-around; overflow-x: auto; scrollbar-width: none; }
    .nav::-webkit-scrollbar { display: none; }
    .nav a { flex: 0 0 auto; flex-direction: column; gap: 2px; padding: 6px 7px; font-size: 11px; }
}

/* ---------------------------------------------------------------- layout */
.wrap { max-width: 860px; margin: 0 auto; padding: 18px 14px 60px; }

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin: 6px 0 16px;
}

.page-head h1 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 24px;
    color: var(--blue-deep);
}

.section-title { font-size: 19px; color: var(--blue-deep); margin: 26px 0 10px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 18px;
    margin-bottom: 14px;
}

.card-title { margin: 0 0 14px; font-size: 18px; color: var(--blue-deep); display: flex; gap: 8px; align-items: center; }

.empty { text-align: center; color: var(--muted); padding: 34px 18px; }

.empty svg { opacity: .45; }

.muted { color: var(--muted); }

.small-note { font-size: 13.5px; }

.ok-note { color: var(--green); font-weight: 600; }

/* ---------------------------------------------------------------- flash */
.flash {
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--green-soft);
    color: var(--green);
    border: 1px solid #BFE3CF;
    padding: 11px 14px;
    border-radius: 10px;
    margin-bottom: 14px;
    font-weight: 600;
}

.flash.error { background: var(--red-soft); color: var(--red); border-color: #EFC7C2; }

.flash.warn { background: var(--gold-soft); color: var(--gold); border-color: #EBDCA8; }

.flash.info { background: #E8F1F5; color: var(--blue-deep); border-color: var(--line); }

.flash a { color: inherit; }

/* ---------------------------------------------------------------- buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 16px;
    min-height: 44px;
    border: 1px solid transparent;
    border-radius: 10px;
    font: 600 15px 'Raleway', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-deep); }

.btn.green { background: var(--green); color: #fff; }
.btn.green:hover { background: #16603D; }

.btn.orange { background: var(--orange); color: #fff; }
.btn.orange:hover { background: #D14E1B; }

.btn.ghost { background: #fff; color: var(--blue-deep); border-color: var(--line); }
.btn.ghost:hover { background: #EFF5F7; }

.btn.danger { background: var(--red); color: #fff; }
.btn.danger.ghost { background: #fff; color: var(--red); border-color: #EFC7C2; }
.btn.danger.ghost:hover { background: var(--red-soft); }

.btn.small { padding: 7px 11px; min-height: 36px; font-size: 13.5px; }

.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
    outline: 3px solid rgba(242, 98, 43, .55);
    outline-offset: 2px;
}

.btn-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 8px; }

.btn-row form { margin: 0; }

.actions { margin-bottom: 14px; }

/* ---------------------------------------------------------------- forms */
.form-card { max-width: 640px; }

.field { display: block; margin-bottom: 14px; }

.field > span, .field legend {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--blue-deep);
    margin-bottom: 5px;
    letter-spacing: .01em;
}

fieldset.field { border: none; padding: 0; margin: 0 0 14px; }

input[type=text], input[type=search], input[type=email], input[type=tel], input[type=date],
input[type=time], input[type=password], select, textarea {
    width: 100%;
    padding: 11px 12px;
    min-height: 44px;
    border: 1.5px solid var(--line);
    border-radius: 9px;
    font: 500 16px 'Raleway', sans-serif;
    color: var(--blue-ink);
    background: #fff;
}

input:focus, select:focus, textarea:focus { border-color: var(--blue); }

textarea { resize: vertical; }

.check-field { display: flex; align-items: center; gap: 10px; cursor: pointer; }

.check-field input { width: 21px; height: 21px; min-height: 0; accent-color: var(--blue); cursor: pointer; }

.check-field > span { margin: 0; font-size: 15px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 540px) { .grid2 { grid-template-columns: 1fr; } }

.item-row {
    display: grid;
    grid-template-columns: 1fr 110px 40px;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.item-row .item-del { min-height: 40px; padding: 6px; }

.total-live { margin-left: auto; color: var(--blue-deep); font-size: 15px; }

.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }

.radio-pill { position: relative; }

.radio-pill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }

.radio-pill span {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    min-height: 44px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    font-weight: 600;
    font-size: 14.5px;
    background: #fff;
    cursor: pointer;
    transition: all .2s;
}

.radio-pill input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }

.radio-pill input:focus-visible + span { outline: 3px solid rgba(242, 98, 43, .55); outline-offset: 2px; }

/* ---------------------------------------------------------------- search */
.searchbar {
    display: flex;
    align-items: center;
    gap: 9px;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    padding: 4px 8px 4px 15px;
    margin-bottom: 16px;
    color: var(--muted);
}

.searchbar input { border: none; min-height: 40px; padding: 6px 0; flex: 1; }

.searchbar input:focus { outline: none; }

.searchbar:focus-within { border-color: var(--blue); }

/* ---------------------------------------------------------------- lists */
.list { display: flex; flex-direction: column; gap: 8px; }

.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    text-decoration: none;
    color: var(--blue-ink);
    transition: border-color .2s, background .2s;
    cursor: pointer;
}

.list-item:hover { border-color: var(--blue); background: #FBFDFD; }

.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.list-main strong { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.list-main small { color: var(--muted); font-size: 13px; }

.list-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

.chevron { color: var(--muted); font-size: 20px; }

.avatar {
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #E8F1F5;
    color: var(--blue-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    font: 700 14px 'Lora', serif;
    letter-spacing: .03em;
}

.doc-badge {
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.doc-badge.facture { background: #E8F1F5; color: var(--blue-deep); }

.doc-badge.recu { background: var(--orange-soft); color: var(--orange); }

.date-badge {
    flex: none;
    width: 46px;
    text-align: center;
    background: #E8F1F5;
    border-radius: 10px;
    padding: 5px 0 4px;
    color: var(--blue-deep);
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.date-badge strong { font-family: 'Lora', serif; font-size: 17px; }

.date-badge small { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }

.status {
    font-size: 12px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    letter-spacing: .02em;
}

.status.emise { background: var(--gold-soft); color: var(--gold); }

.status.payee { background: var(--green-soft); color: var(--green); }

.status.annulee { background: var(--red-soft); color: var(--red); }

.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs-filter { align-items: center; }
.month-filter { margin: 0 0 0 auto; display: inline-flex; align-items: center; gap: 6px; color: var(--blue-deep); }
.month-filter select {
    width: auto; min-height: 40px; padding: 8px 34px 8px 14px; border-radius: 999px;
    border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; color: var(--blue-deep);
}
.month-filter select:hover { border-color: var(--blue); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 560px) { .month-filter { margin-left: 0; width: 100%; } .month-filter select { flex: 1; } }

.tab {
    padding: 9px 16px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--blue-deep);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all .2s;
}

.tab:hover { border-color: var(--blue); }

.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------------------------------------------------------------- details */
.details { margin: 0 0 6px; }

.details > div { display: flex; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--line); }

.details > div:last-child { border-bottom: none; }

.details dt { flex: none; width: 140px; color: var(--muted); font-size: 14px; }

.details dd { margin: 0; font-weight: 500; }

@media (max-width: 540px) {
    .details > div { flex-direction: column; gap: 1px; }
    .details dt { width: auto; font-size: 12.5px; }
}

.danger-zone { margin-top: 26px; color: var(--muted); }

.danger-zone summary { cursor: pointer; font-size: 14px; padding: 6px 0; }

.danger-zone form { margin-top: 10px; }

/* ---------------------------------------------------------------- export */
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }

.export-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    text-decoration: none;
    color: var(--blue-deep);
    padding: 24px 14px;
    cursor: pointer;
    transition: border-color .2s, transform .2s;
}

.export-card:hover { border-color: var(--blue); }

.export-card strong { font-size: 16px; }

.export-card small { color: var(--muted); }

/* ---------------------------------------------------------------- login */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 22px 16px;
    background: linear-gradient(170deg, var(--blue) 0%, var(--blue-deep) 100%);
}

.login-hero { text-align: center; color: #fff; margin-bottom: 22px; }

.login-logo {
    width: min(288px, 72vw);
    height: auto;
    background: #fff;
    border-radius: 18px;
    padding: 10px 18px;
    box-shadow: var(--shadow);
}

.login-hero h1 { margin: 12px 0 2px; font-size: 23px; }

.login-hero p { margin: 0; opacity: .85; font-size: 14.5px; }

.login-card { width: 100%; max-width: 380px; }

.login-card .btn { width: 100%; }

/* ---------------------------------------------------------------- document (facture / reçu) */
.doc-sheet {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(20px, 5vw, 46px);
    max-width: 800px;
    margin: 0 auto 20px;
    font-size: 15px;
}

.doc-top { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; }

.doc-logo { width: 96px; height: auto; margin: 0 0 10px -4px; }

.doc-issuer h2 { margin: 0; font-size: 20px; color: var(--blue-ink); }

.doc-role { margin: 1px 0 10px; font-style: italic; color: var(--muted); }

.doc-contact { margin: 0 0 10px; line-height: 1.5; }

.doc-legal { margin: 0; font-size: 13.5px; color: var(--muted); }

.doc-meta { text-align: right; }

.doc-title {
    font-size: clamp(30px, 6vw, 42px);
    color: var(--blue);
    font-weight: 500;
    margin-bottom: 14px;
}

.doc-meta-table { margin-left: auto; border-collapse: collapse; }

.doc-meta-table th { text-align: right; color: var(--muted); font-size: 12.5px; letter-spacing: .05em; padding: 2px 10px 2px 0; }

.doc-meta-table td { text-align: right; padding: 2px 0; }

.doc-mid { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin: 26px 0 20px; }

.doc-to { display: flex; gap: 14px; }

.doc-to-label { color: var(--muted); font-style: italic; }

.doc-to p { margin: 0; line-height: 1.55; }
.doc-concerning { font-style: italic; color: var(--muted); }

.doc-refs { border-collapse: collapse; }

.doc-refs th { text-align: right; color: var(--muted); font-weight: 500; padding: 2px 12px 2px 0; font-size: 14px; }

.doc-refs td { text-align: right; padding: 2px 0; }

.doc-items { width: 100%; border-collapse: collapse; margin: 8px 0 18px; }

.doc-items thead th {
    background: var(--blue);
    color: #fff;
    text-align: left;
    padding: 9px 12px;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.doc-items tbody td { border: 1px solid var(--line); padding: 10px 12px; }

.doc-items .num { text-align: right; white-space: nowrap; width: 130px; }

.doc-items tfoot th {
    padding: 11px 12px;
    text-align: right;
    font-size: 15px;
}

.doc-items tfoot .num { background: var(--orange-soft); color: var(--blue-ink); border: 1.5px solid var(--orange); font-size: 16px; }

.doc-payment { font-size: 14.5px; }

.doc-payment p { margin: 6px 0; }

.doc-bank { background: var(--paper); border: 1px dashed var(--line); border-radius: 8px; padding: 10px 13px; }

.doc-notes { color: var(--muted); font-style: italic; }

.doc-next-rdv {
    background: var(--orange-soft);
    border: 1px solid var(--orange);
    border-radius: 8px;
    padding: 10px 13px;
    display: inline-block;
}

.doc-cancel { color: var(--red); font-weight: 800; letter-spacing: .1em; margin-left: 8px; }

.doc-policy {
    margin-top: 30px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.5;
}

.doc-policy p { margin: 0 0 4px; }

.doc-policy ul { margin: 0; padding-left: 18px; }

.public-page { background: var(--paper); }

/* ------------------------------------------------------------ export PDF */
.pdf-page { margin-bottom: 26px; }

/* ---------------------------------------------------------------- print */
@media print {
    body { background: #fff; }
    .topbar, .no-print, .flash, .danger-zone { display: none !important; }
    .pdf-page { page-break-after: always; margin-bottom: 0; }
    .pdf-page:last-of-type { page-break-after: auto; }
    .wrap { max-width: none; padding: 0; }
    .doc-sheet { border: none; box-shadow: none; padding: 0; max-width: none; font-size: 13px; }
    .doc-items thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .doc-items tfoot .num { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

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

/* ---- Datepicker maison (lundi en premier) ---- */
.dp-input { cursor: pointer; background: var(--card); }
.dp-pop {
    position: absolute;
    z-index: 60;
    top: 100%;
    left: 0;
    margin-top: 6px;
    width: 292px;
    max-width: 96vw;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
}
.dp-head { display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.dp-nav {
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--blue-deep);
    border-radius: 8px;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}
.dp-nav:hover { background: var(--paper); }
.dp-mois, .dp-annee {
    flex: 1;
    min-width: 0;
    padding: 5px 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    color: var(--blue-ink);
    background: var(--card);
}
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    padding: 3px 0;
}
.dp-day {
    border: none;
    background: none;
    font: inherit;
    font-size: 14px;
    color: var(--blue-ink);
    padding: 6px 0;
    border-radius: 8px;
    cursor: pointer;
}
.dp-day:hover { background: var(--paper); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--blue); }
.dp-day.sel { background: var(--orange); color: #fff; font-weight: 700; }
.dp-foot { margin-top: 8px; text-align: right; }
.dp-clear {
    border: none;
    background: none;
    font: inherit;
    font-size: 13px;
    color: var(--muted);
    cursor: pointer;
    text-decoration: underline;
}

/* ---- instance de démonstration (APP_DEMO) ---- */
.demo-badge { margin-left: 8px; padding: 3px 9px; border-radius: 999px; background: #F2622B; color: #fff;
  font: 700 11px/1.4 Raleway, sans-serif; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }

/* ---- fiche patient : RDV à venir + confirmation ---- */
.rdv-item { flex-wrap: wrap; cursor: default; }
.rdv-item .list-main strong a { color: inherit; text-decoration: none; }
.rdv-item .list-main strong a:hover { color: var(--blue); }
.rdv-item .list-main small .ok { color: var(--green); font-weight: 600; }
.rdv-actions { margin-top: 0; }
@media (max-width: 640px) { .rdv-actions { width: 100%; } }

/* ---- signature (Paramètres + documents) ---- */
.sig-pad-wrap { border: 1.5px dashed var(--line, #C9D6DD); border-radius: 12px; background: #FBFDFD; padding: 8px; margin-bottom: 12px; }
#sigpad { width: 100%; height: auto; aspect-ratio: 3 / 1; display: block; background: #fff; border-radius: 8px; touch-action: none; cursor: crosshair; }
.sig-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sig-current { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.sig-current img { height: 64px; max-width: 220px; background: #fff; border: 1px solid #E3EBEF; border-radius: 8px; padding: 4px; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0 14px; font-size: 14.5px; line-height: 1.45; }
.consent input { margin-top: 4px; flex: none; }
.doc-sign { margin-top: 14px; text-align: right; }
.doc-sign-cert { margin: 0 0 4px; font-size: 12.5px; font-style: italic; color: var(--muted); }
.doc-sign-img { height: 68px; max-width: 220px; }
.doc-sign-name { margin: 2px 0 0; font-weight: 600; font-size: 13.5px; }
.doc-sign-name span { font-weight: 400; font-style: italic; color: var(--muted); }

/* ---- créneaux (slots.php) + réservation publique (reserver.php) ---- */
.slots-forms { align-items: start; }
@media (max-width: 720px) { .slots-forms { grid-template-columns: 1fr; } }
.day-picks { display: flex; gap: 6px; flex-wrap: wrap; }
.day-pick input { position: absolute; opacity: 0; }
.day-pick span { display: inline-block; min-width: 42px; text-align: center; padding: 7px 9px; border: 1.5px solid #C9D6DD; border-radius: 999px; font-weight: 600; font-size: 13.5px; cursor: pointer; }
.day-pick input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.slot-day h3 { margin: 0 0 8px; font-size: 15.5px; color: var(--blue-deep); }
.slot-day + .slot-day { margin-top: 16px; }
.slot-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.slot-chip { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 10px; border: 1.5px solid #C9D6DD; background: #fff; text-decoration: none; color: inherit; margin: 0; }
.slot-chip strong { font-size: 15px; }
.slot-chip small { color: var(--muted); font-size: 12.5px; }
.slot-chip.booked { background: var(--orange-soft); border-color: var(--orange); }
.slot-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 2px; display: inline-flex; }
.slot-chip button:hover { color: var(--red); }
.slot-pick input { position: absolute; opacity: 0; }
.slot-pick span { display: inline-block; padding: 9px 14px; border: 1.5px solid #C9D6DD; border-radius: 10px; font-weight: 600; font-size: 15px; cursor: pointer; background: #fff; }
.slot-pick input:checked + span { background: var(--orange); border-color: var(--orange); color: #fff; }
.mode-picks { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-pick input { position: absolute; opacity: 0; }
.mode-pick span { display: inline-block; padding: 9px 16px; border: 1.5px solid #C9D6DD; border-radius: 999px; font-weight: 600; cursor: pointer; }
.mode-pick input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.mode-pick.disabled span { opacity: .4; cursor: not-allowed; }
.booking { max-width: 720px; margin: 0 auto; }
.booking-intro { color: var(--muted); margin: -6px 0 16px; line-height: 1.5; }
.booking .step { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #fff; align-items: center; justify-content: center; font-size: 14px; margin-right: 6px; }
.booking .hp { position: absolute; left: -9999px; }
.btn.big { padding: 13px 22px; font-size: 16px; }
.booking-done { text-align: center; padding: 34px 22px; }
.booking-done-icon { width: 62px; height: 62px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.booking-done h2 { margin: 0 0 6px; color: var(--blue-deep); }
.booking-when { font-size: 19px; font-weight: 600; margin: 4px 0 10px; }
.status.online { background: #E8F1F5; color: var(--blue-deep); }

/* ---------------------------------------------------------------- RDV en attente de confirmation (v15) */
.status.pending { background: #FFF3C4; color: #8A6400; }
.list-item.pending { border-style: dashed; border-color: #E5C24A; background: #FFFBEB; }
.list-item.pending .date-badge { background: #FFF3C4; color: #8A6400; }
.todo-ico.pending { background: #FFF3C4; color: #8A6400; }
.radio-pill.pending input:checked + span { background: #E5A800; border-color: #E5A800; color: #1F3A47; }
.pending-flash { background: #FFF8DB; border-color: #E5C24A; color: #5A4A00; }
.field-help { display: block; margin-top: 6px; font-size: 12.5px; line-height: 1.45; }

/* ---------------------------------------------------------------- entreprises (v15) */
.avatar.company { background: #E8F1F5; color: var(--blue-deep); display: inline-flex; align-items: center; justify-content: center; }
.inline-ico { vertical-align: -2px; color: var(--blue-deep); }
.via-ent { font-weight: 500; font-size: 12.5px; }
.subcard { padding: 14px 16px; margin: 0 0 14px; background: #F7FAFB; box-shadow: none; border: 1px dashed var(--border, #D9E3E8); }
.field-link { float: right; font-size: 12px; font-weight: 500; color: var(--blue-deep); }

/* ---------------------------------------------------------------- accueil / tableau de bord (v12) */
.dash-sub { margin: -8px 0 16px; font-size: 14px; }
.dash-sub::first-letter { text-transform: uppercase; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 8px; }
.stat {
    display: flex; flex-direction: column; gap: 4px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px 16px; text-decoration: none; color: var(--blue-ink); box-shadow: var(--shadow);
    transition: border-color .2s, transform .2s;
}
.stat:hover { border-color: var(--blue); transform: translateY(-1px); }
.stat-main { background: var(--blue-deep); border-color: var(--blue-deep); color: #fff; }
.stat-main:hover { border-color: var(--blue-ink); }
.stat-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat-main .stat-label { color: #D8E7EE; }
.stat-value { font-family: 'Lora', Georgia, serif; font-size: 26px; line-height: 1.15; font-weight: 600; }
.stat-main .stat-value { color: #fff; }
.stat-unit { font-family: 'Raleway', sans-serif; font-size: 14px; font-weight: 600; color: var(--muted); }
.stat-foot { font-size: 12.5px; color: var(--muted); }
.stat-main .stat-foot { color: #D8E7EE; }
.stat-foot .up { color: var(--green); font-weight: 700; }
.stat-foot .down { color: var(--red); font-weight: 700; }
.stat-main .stat-foot .up { color: #A8E6C3; }
.stat-main .stat-foot .down { color: #F8B4A9; }
.dash-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.section-link { margin-left: auto; font-family: 'Raleway', sans-serif; font-size: 13px; font-weight: 600; text-decoration: none; }
.section-link:hover { text-decoration: underline; }
.section-title { display: flex; align-items: baseline; gap: 10px; }
.list-item.today { border-color: var(--orange); }
.list-item.today .date-badge { background: var(--orange); color: #fff; }
.todo-ico {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%;
    background: var(--red-soft); color: var(--red);
    display: inline-flex; align-items: center; justify-content: center;
}
.todo-ico.gold { background: var(--gold-soft); color: var(--gold); }
.histo-card { padding: 16px 14px 10px; }
.histo { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 170px; align-items: end; }
.histo-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; text-decoration: none; color: var(--muted); gap: 4px; }
.histo-val { font-size: 10.5px; font-weight: 700; color: var(--blue-deep); white-space: nowrap; opacity: 0; transition: opacity .15s; }
.histo-col:hover .histo-val, .histo-col.current .histo-val { opacity: 1; }
.histo-bar { width: 100%; max-width: 38px; background: #B9D0DA; border-radius: 6px 6px 3px 3px; min-height: 2px; transition: background .15s; }
.histo-col:hover .histo-bar { background: var(--blue); }
.histo-col.current .histo-bar { background: var(--orange); }
.histo-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; white-space: nowrap; }
@media (max-width: 760px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dash-cols { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .stat-value { font-size: 22px; }
    .histo { gap: 3px; height: 140px; }
    .histo-lbl { font-size: 9.5px; }
    .histo-val { display: none; }
}

/* ---------------------------------------------------------------- import patients CSV (v14) */
.import-map { max-width: 100%; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; margin-bottom: 10px; }
.map-grid .field { margin-bottom: 0; }
.map-grid .field > span small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; }
.import-counts { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.import-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.import-table th { text-align: left; font-size: 12px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 6px 8px; border-bottom: 2px solid var(--line, #C9D6DD); white-space: nowrap; }
.import-table td { padding: 7px 8px; border-bottom: 1px solid #E3EBEF; vertical-align: top; }
.import-table tr.st-erreur td { background: #FFF6F6; }
.import-table tr.st-doublon td { background: #FFFBEF; }
.import-table tr.st-doublon td:not(:first-child):not(:last-child) { color: var(--muted); }
