/* =============================================================================
   EffaCare — thème d'interface
   Palette « bloc opératoire » : encre bleu-vert, teal tenue de bloc, surfaces froides.
   Toutes les règles sont préfixées par body.cf-theme pour passer devant les styles
   injectés par les modules sans toucher à leur code.
   ============================================================================= */

@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('../fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url('../fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    /* Couleurs de base */
    --cf-ink: #16262b;          /* texte, titres */
    --cf-ink-2: #4a5d62;        /* texte secondaire */
    --cf-ink-3: #74878b;        /* texte discret */
    --cf-teal: #1c6b68;         /* action principale, élément actif */
    --cf-teal-strong: #14524f;  /* survol */
    --cf-teal-wash: #e4efed;    /* fond sélectionné */
    --cf-surface: #f3f6f5;      /* fond de l'application */
    --cf-panel: #ffffff;
    --cf-line: #d9e1df;
    --cf-line-soft: #e8edec;
    --cf-amber: #a96400;  --cf-amber-wash: #fdf1dc;
    --cf-red: #b42318;    --cf-red-wash: #fdecea;
    --cf-green: #2d7a4e;  --cf-green-wash: #e5f3ea;
    --cf-blue: #2f5d8a;   --cf-blue-wash: #e6eef6;
    --cf-radius: 10px;
    --cf-radius-sm: 6px;
    --cf-shadow-overlay: 0 12px 32px rgba(22, 38, 43, .16), 0 2px 6px rgba(22, 38, 43, .08);
    --cf-font: 'Atkinson Hyperlegible Next', 'Segoe UI', system-ui, -apple-system, sans-serif;

    /* Anciennes variables réalignées sur la palette (utilisées par les modules) */
    --primary: var(--cf-teal);
    --primary-dark: var(--cf-teal-strong);
    --primary-color: var(--cf-teal);
    --secondary-color: var(--cf-teal);
    --success: var(--cf-green);
    --warning: var(--cf-amber);
    --danger: var(--cf-red);
    --gray-50: #f7f9f8; --gray-100: var(--cf-surface); --gray-200: var(--cf-line-soft); --gray-300: var(--cf-line);
    --gray-400: #9aaaad; --gray-500: var(--cf-ink-3); --gray-600: var(--cf-ink-2); --gray-700: #33464b;
    --gray-800: #23363b; --gray-900: var(--cf-ink);
    --sidebar-width: 248px;
}

/* -----------------------------------------------------------------------------
   Base
   ----------------------------------------------------------------------------- */
body.cf-theme {
    font-family: var(--cf-font);
    font-size: 14px;
    line-height: 1.45;
    color: var(--cf-ink);
    background: var(--cf-surface);
    -webkit-font-smoothing: antialiased;
    font-variant-numeric: tabular-nums;
}
body.cf-theme h1, body.cf-theme h2, body.cf-theme h3, body.cf-theme h4 { color: var(--cf-ink); letter-spacing: -0.005em; }
body.cf-theme input, body.cf-theme select, body.cf-theme textarea, body.cf-theme button { font-family: inherit; }
body.cf-theme :focus-visible { outline: 2px solid var(--cf-teal); outline-offset: 2px; }
body.cf-theme ::selection { background: var(--cf-teal-wash); }

/* Coque : le bandeau démo fait partie de la colonne, plus de débordement */
body.cf-theme { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
/* Téléphones : 100dvh suit la hauteur réellement visible (barre d'adresse comprise) ; sans lui, le bas des pages passait sous la barre du navigateur */
body.cf-theme .main-content { padding-bottom: calc(40px + env(safe-area-inset-bottom)); }
body.cf-theme .app-container { flex: 1; height: auto; min-height: 0; }
body.cf-theme .sidebar, body.cf-theme .main-wrapper { height: 100%; }

body.cf-theme #demoBanner {
    position: static !important;
    background: var(--cf-amber-wash) !important;
    color: #6b4200 !important;
    border-bottom: 1px solid #efd3a3 !important;
    font-size: 12.5px !important;
    padding: 6px 16px !important;
}

/* -----------------------------------------------------------------------------
   Barre latérale : claire, discrète, l'élément actif porte la couleur
   ----------------------------------------------------------------------------- */
body.cf-theme .sidebar {
    background: var(--cf-panel);
    color: var(--cf-ink);
    border-right: 1px solid var(--cf-line);
}
body.cf-theme .sidebar-header { padding: 18px 20px 16px; border-bottom: 1px solid var(--cf-line-soft); }
body.cf-theme .sidebar-logo { font-size: 17px; font-weight: 700; color: var(--cf-ink); gap: 10px; letter-spacing: -0.01em; }
body.cf-theme .sidebar-logo i {
    color: #fff; background: var(--cf-teal); width: 30px; height: 30px; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
body.cf-theme .sidebar-nav { padding: 10px 10px 16px; }
body.cf-theme .nav-section { margin-bottom: 14px; }
body.cf-theme .nav-section-title {
    text-transform: none; font-size: 12px; font-weight: 600; color: var(--cf-ink-3);
    padding: 6px 10px 4px; letter-spacing: 0;
}
body.cf-theme .nav-item {
    color: var(--cf-ink-2); border-radius: 7px; padding: 8px 10px; font-size: 14px; font-weight: 500;
    gap: 11px; margin: 1px 0; position: relative; transition: background-color .12s, color .12s;
}
body.cf-theme .nav-item i { color: var(--cf-ink-3); font-size: 14px; width: 18px; }
body.cf-theme .nav-item:hover { background: var(--cf-surface); color: var(--cf-ink); }
body.cf-theme .nav-item.active { background: var(--cf-teal-wash); color: var(--cf-teal-strong); font-weight: 600; }
body.cf-theme .nav-item.active i { color: var(--cf-teal); }
body.cf-theme .nav-item.active::before {
    content: ''; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--cf-teal);
}

/* -----------------------------------------------------------------------------
   En-tête
   ----------------------------------------------------------------------------- */
body.cf-theme .main-header {
    background: var(--cf-panel); border-bottom: 1px solid var(--cf-line); min-height: 60px; padding: 10px 28px;
}
body.cf-theme .page-title { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
body.cf-theme .user-btn, body.cf-theme .notification-btn { background: transparent; border: 1px solid var(--cf-line); border-radius: 8px; }
body.cf-theme .user-btn:hover, body.cf-theme .notification-btn:hover { background: var(--cf-surface); }
body.cf-theme .user-avatar { background: var(--cf-teal); font-weight: 700; }
body.cf-theme .user-name { font-weight: 600; color: var(--cf-ink); }
body.cf-theme .user-role { color: var(--cf-ink-3); text-transform: capitalize; }
body.cf-theme #userMenu, body.cf-theme #notifPanel { border: 1px solid var(--cf-line); box-shadow: var(--cf-shadow-overlay); border-radius: var(--cf-radius); }
body.cf-theme .main-content { padding: 24px 28px 40px; }

/* -----------------------------------------------------------------------------
   Panneaux et cartes : bordure fine, pas d'ombre (l'ombre est réservée aux calques)
   ----------------------------------------------------------------------------- */
body.cf-theme .card,
body.cf-theme .stat-card, body.cf-theme .kpi-card, body.cf-theme .finance-stat-card,
body.cf-theme .report-card, body.cf-theme .acc-card, body.cf-theme .report-stat,
body.cf-theme .settings-nav, body.cf-theme .privacy-section {
    background: var(--cf-panel);
    border: 1px solid var(--cf-line);
    border-radius: var(--cf-radius);
    box-shadow: none;
}
body.cf-theme .card { padding: 20px 22px; margin-bottom: 18px; }
body.cf-theme .stat-card:hover, body.cf-theme .kpi-card:hover, body.cf-theme .report-card:hover { transform: none; box-shadow: none; border-color: #c5d1ce; }
body.cf-theme .card-header {
    background: transparent; border-bottom: 1px solid var(--cf-line-soft); padding: 0 0 14px; margin-bottom: 16px;
}
body.cf-theme .card-header h2, body.cf-theme .card-header h3, body.cf-theme .card h2, body.cf-theme .card h3 { font-size: 16.5px; font-weight: 700; }
body.cf-theme .card-body { padding: 0; }
body.cf-theme .stat-value, body.cf-theme .kpi-value, body.cf-theme .report-stat-value, body.cf-theme .stat-card-value {
    color: var(--cf-ink); font-weight: 700; letter-spacing: -0.01em;
}
body.cf-theme .stat-label, body.cf-theme .kpi-label, body.cf-theme .report-stat-label, body.cf-theme .stat-card-label {
    color: var(--cf-ink-3); font-size: 12.5px; text-transform: none; letter-spacing: 0;
}

/* -----------------------------------------------------------------------------
   Boutons
   ----------------------------------------------------------------------------- */
body.cf-theme .btn {
    border-radius: var(--cf-radius-sm); font-weight: 600; font-size: 13.5px; padding: 8px 14px;
    border: 1px solid transparent; box-shadow: none; transform: none; transition: background-color .12s, border-color .12s;
    line-height: 1.3; width: auto;
}
body.cf-theme .btn:hover { transform: none; box-shadow: none; }
body.cf-theme .btn-primary { background: var(--cf-teal); color: #fff; border-color: var(--cf-teal); }
body.cf-theme .btn-primary:hover { background: var(--cf-teal-strong); border-color: var(--cf-teal-strong); }
body.cf-theme .btn-secondary { background: var(--cf-panel); color: var(--cf-ink); border-color: var(--cf-line); }
body.cf-theme .btn-secondary:hover { background: var(--cf-surface); border-color: #c5d1ce; }
body.cf-theme .btn-success { background: var(--cf-green); color: #fff; border-color: var(--cf-green); }
body.cf-theme .btn-warning { background: var(--cf-amber); color: #fff; border-color: var(--cf-amber); }
body.cf-theme .btn-danger { background: var(--cf-panel); color: var(--cf-red); border-color: #f0c3be; }
body.cf-theme .btn-danger:hover { background: var(--cf-red-wash); }
body.cf-theme .btn-sm { padding: 5px 10px; font-size: 12.5px; }
body.cf-theme .tab-btn {
    background: transparent; color: var(--cf-ink-2); border: 1px solid transparent; border-radius: 7px;
    font-weight: 600; padding: 7px 12px;
}
body.cf-theme .tab-btn:hover { background: var(--cf-panel); border-color: var(--cf-line); }
body.cf-theme .tab-btn.active { background: var(--cf-panel); color: var(--cf-teal-strong); border-color: var(--cf-teal); box-shadow: inset 0 -2px 0 var(--cf-teal); }
body.cf-theme .action-btn {
    width: 30px; height: 30px; border-radius: 7px; border: 1px solid var(--cf-line); background: var(--cf-panel);
    color: var(--cf-ink-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
body.cf-theme .action-btn:hover { background: var(--cf-surface); color: var(--cf-ink); }
body.cf-theme .action-btn.delete, body.cf-theme .action-btn.delete i { color: var(--cf-red); }
body.cf-theme .action-btn.edit, body.cf-theme .action-btn.edit i { color: var(--cf-teal); }

/* -----------------------------------------------------------------------------
   Formulaires
   ----------------------------------------------------------------------------- */
body.cf-theme .form-control,
body.cf-theme .modal input:not([type=checkbox]):not([type=radio]),
body.cf-theme .modal select, body.cf-theme .modal textarea {
    border: 1px solid var(--cf-line); border-radius: var(--cf-radius-sm); background: #fff; color: var(--cf-ink);
    font-size: 14px; padding: 8px 11px; min-height: 38px; transition: border-color .12s, box-shadow .12s;
}
body.cf-theme .form-control:focus,
body.cf-theme .modal input:focus, body.cf-theme .modal select:focus, body.cf-theme .modal textarea:focus {
    outline: none; border-color: var(--cf-teal); box-shadow: 0 0 0 3px rgba(28, 107, 104, .16);
}
body.cf-theme .form-group label { color: var(--cf-ink-2); font-weight: 600; font-size: 13px; }
body.cf-theme .required { color: var(--cf-red); }

/* -----------------------------------------------------------------------------
   Tableaux
   ----------------------------------------------------------------------------- */
body.cf-theme table { border-collapse: collapse; width: 100%; }
body.cf-theme .table-responsive, body.cf-theme .table-container {
    border: 1px solid var(--cf-line); border-radius: var(--cf-radius); overflow: auto; background: #fff;
}
body.cf-theme table th {
    background: #f7f9f8 !important; color: var(--cf-ink-2) !important; font-size: 12.5px; font-weight: 700;
    text-transform: none !important; letter-spacing: 0 !important; text-align: left;
    padding: 10px 14px !important; border-bottom: 1px solid var(--cf-line) !important; white-space: nowrap;
}
body.cf-theme table td {
    padding: 11px 14px !important; border-bottom: 1px solid var(--cf-line-soft) !important; color: var(--cf-ink);
    vertical-align: middle; font-size: 13.5px;
}
body.cf-theme table tbody tr:last-child td { border-bottom: none !important; }
body.cf-theme table tbody tr:hover td { background: #f8fbfa; }

/* -----------------------------------------------------------------------------
   Pastilles de statut
   ----------------------------------------------------------------------------- */
body.cf-theme .badge, body.cf-theme .badge-status {
    display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px;
    font-size: 12px; font-weight: 600; line-height: 1.4; border: 1px solid transparent; text-transform: none;
}
body.cf-theme .badge-success { background: var(--cf-green-wash) !important; color: var(--cf-green) !important; }
body.cf-theme .badge-warning { background: var(--cf-amber-wash) !important; color: var(--cf-amber) !important; }
body.cf-theme .badge-danger  { background: var(--cf-red-wash) !important;   color: var(--cf-red) !important; }
body.cf-theme .badge-primary, body.cf-theme .badge-info { background: var(--cf-blue-wash) !important; color: var(--cf-blue) !important; }

/* -----------------------------------------------------------------------------
   Fenêtres modales
   ----------------------------------------------------------------------------- */
body.cf-theme .modal { background: rgba(22, 38, 43, .42); backdrop-filter: blur(2px); }
body.cf-theme .modal-content {
    border-radius: 12px; border: 1px solid var(--cf-line); box-shadow: var(--cf-shadow-overlay);
    /* Les longs formulaires défilent dans la fenêtre : en-tête et boutons restent visibles */
    max-height: calc(100vh - 32px) !important; max-height: calc(100dvh - 32px) !important; overflow-y: auto !important; overscroll-behavior: contain;
}
body.cf-theme .modal-content > .modal-header, body.cf-theme .modal-content > form > .modal-header { position: sticky; top: 0; z-index: 2; }
body.cf-theme .modal-content > .modal-footer, body.cf-theme .modal-content > form > .modal-footer { position: sticky; bottom: 0; z-index: 2; }
body.cf-theme .modal-content .modal-body { max-height: none !important; overflow: visible; }
body.cf-theme .modal-header {
    background: #fff !important; color: var(--cf-ink) !important; border-bottom: 1px solid var(--cf-line-soft); padding: 16px 22px;
}
body.cf-theme .modal-header h2, body.cf-theme .modal-header h3 { color: var(--cf-ink) !important; font-size: 17px; font-weight: 700; }
body.cf-theme .modal-close { color: var(--cf-ink-3) !important; background: transparent; border: none; }
body.cf-theme .modal-body { padding: 20px 22px; }
body.cf-theme .modal-footer { background: #f7f9f8; border-top: 1px solid var(--cf-line-soft); padding: 12px 22px; }

/* -----------------------------------------------------------------------------
   Notifications, bannière cookies
   ----------------------------------------------------------------------------- */
body.cf-theme .toast-notification { border-radius: 8px; box-shadow: var(--cf-shadow-overlay); }
body.cf-theme .toast-success { background: var(--cf-green); }
body.cf-theme .toast-error { background: var(--cf-red); }
body.cf-theme .toast-info { background: var(--cf-teal); }
body.cf-theme .cookie-banner {
    background: var(--cf-panel); color: var(--cf-ink); border-top: 1px solid var(--cf-line); box-shadow: 0 -6px 20px rgba(22, 38, 43, .08);
    left: auto; right: 20px; bottom: 20px; max-width: 520px; border-radius: 12px; border: 1px solid var(--cf-line);
    z-index: 900; /* sous les fenêtres modales, pour ne jamais masquer leurs boutons */
}
body.cf-theme .modal, body.cf-theme #extBillingModal { z-index: 10000; }
body.cf-theme .cookie-content { flex-direction: column; align-items: flex-start; gap: 12px; }
body.cf-theme .cookie-text { min-width: 0; }
body.cf-theme .cookie-text p { color: var(--cf-ink-2); }
body.cf-theme .cookie-text a { color: var(--cf-teal); }
body.cf-theme .cookie-btn-accept { background: var(--cf-teal); }
body.cf-theme .cookie-btn-settings { color: var(--cf-ink); border-color: var(--cf-line); }
body.cf-theme .cookie-btn-settings:hover { background: var(--cf-surface); }

/* Couleurs codées en dur dans les modules, réalignées sur la palette */
body.cf-theme [style*="background: #3b82f6"], body.cf-theme [style*="background:#3b82f6"],
body.cf-theme [style*="background: linear-gradient(135deg, #3b82f6"], body.cf-theme [style*="background:linear-gradient(135deg,#3b82f6"],
body.cf-theme [style*="background: linear-gradient(135deg, #1e40af"], body.cf-theme [style*="background: linear-gradient(135deg, #2563eb"] {
    background: var(--cf-teal) !important;
}

/* =============================================================================
   Tableau de bord « Journée »
   ============================================================================= */
.cf-day { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; }
.cf-day-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.cf-day-intro h2 { font-size: 24px; font-weight: 700; letter-spacing: -0.015em; }
.cf-day-intro p { color: var(--cf-ink-2); font-size: 14px; }

.cf-figures {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; background: var(--cf-panel);
    border: 1px solid var(--cf-line); border-radius: var(--cf-radius); margin-bottom: 20px;
}
.cf-figure { padding: 14px 18px; border-left: 1px solid var(--cf-line-soft); cursor: pointer; text-align: left; background: none; border-top: 0; border-right: 0; border-bottom: 0; font: inherit; color: inherit; }
.cf-figure:first-child { border-left: 0; }
.cf-figure:hover { background: #f8fbfa; }
.cf-figure strong { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; color: var(--cf-ink); }
.cf-figure span { font-size: 13px; color: var(--cf-ink-2); }
.cf-figure.is-alert strong { color: var(--cf-amber); }

.cf-board { background: var(--cf-panel); border: 1px solid var(--cf-line); border-radius: var(--cf-radius); overflow: hidden; }
.cf-board-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--cf-line-soft); gap: 12px; flex-wrap: wrap; }
.cf-board-head h3 { font-size: 16px; font-weight: 700; }
.cf-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--cf-ink-2); flex-wrap: wrap; }
.cf-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.cf-grid { display: grid; position: relative; overflow-x: auto; }
.cf-col-head { position: sticky; top: 0; z-index: 2; background: #f7f9f8; border-bottom: 1px solid var(--cf-line); padding: 10px 12px; font-weight: 700; font-size: 13.5px; border-left: 1px solid var(--cf-line-soft); }
.cf-col-head small { display: block; font-weight: 500; color: var(--cf-ink-3); font-size: 12px; }
.cf-hours { border-right: 1px solid var(--cf-line-soft); }
.cf-hour { height: 64px; font-size: 12px; color: var(--cf-ink-3); padding: 2px 8px 0 0; text-align: right; position: relative; }
.cf-lane { position: relative; border-left: 1px solid var(--cf-line-soft); background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 63px, var(--cf-line-soft) 63px, var(--cf-line-soft) 64px); }
.cf-appt {
    position: absolute; left: 6px; right: 6px; border-radius: 6px; padding: 5px 8px; font-size: 12.5px; line-height: 1.3;
    overflow: hidden; border: 0; border-left: 3px solid; cursor: pointer; text-align: left; font-family: inherit;
    transition: box-shadow .12s;
}
.cf-appt:hover { box-shadow: 0 0 0 1px currentColor inset; }
.cf-appt:focus-visible { outline: 2px solid var(--cf-teal); outline-offset: 1px; }
.cf-appt b { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-appt span { color: inherit; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cf-appt.s-confirme   { background: var(--cf-teal-wash); border-color: var(--cf-teal); color: var(--cf-teal-strong); }
.cf-appt.s-en_attente { background: var(--cf-amber-wash); border-color: var(--cf-amber); color: #6b4200; }
.cf-appt.s-termine    { background: #eef1f0; border-color: #9aaaad; color: var(--cf-ink-2); }
.cf-appt.s-annule     { background: #fff; border-color: #d0d6d5; color: var(--cf-ink-3); text-decoration: line-through; }
.cf-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--cf-red); z-index: 3; pointer-events: none; }
.cf-now::before { content: ''; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--cf-red); }
.cf-empty { padding: 36px 20px; text-align: center; color: var(--cf-ink-2); }
.cf-empty .btn { margin-top: 12px; }

.cf-side { display: flex; flex-direction: column; gap: 16px; }
.cf-panel { background: var(--cf-panel); border: 1px solid var(--cf-line); border-radius: var(--cf-radius); }
.cf-panel h3 { font-size: 15px; font-weight: 700; padding: 14px 16px 10px; }
.cf-list { list-style: none; margin: 0; padding: 0 0 6px; }
.cf-list li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 16px; border-top: 1px solid var(--cf-line-soft); font-size: 13.5px; }
.cf-list li span:last-child { color: var(--cf-ink-2); white-space: nowrap; }
.cf-list li.is-alert span:last-child { color: var(--cf-amber); font-weight: 600; }
.cf-list li.is-danger span:last-child { color: var(--cf-red); font-weight: 600; }
.cf-panel .cf-more { display: block; padding: 10px 16px; border-top: 1px solid var(--cf-line-soft); color: var(--cf-teal); font-weight: 600; font-size: 13px; cursor: pointer; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; font-family: inherit; }
.cf-panel .cf-more:hover { background: #f8fbfa; }
.cf-skeleton { height: 14px; border-radius: 4px; background: var(--cf-line-soft); margin: 10px 16px; }

@media (max-width: 1100px) {
    .cf-day { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
    .cf-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cf-figure:nth-child(3) { border-left: 0; }
    .cf-figure:nth-child(n+3) { border-top: 1px solid var(--cf-line-soft); }
    body.cf-theme .main-content { padding: 16px; }
    body.cf-theme .main-header { padding: 10px 16px; }
}
@media (prefers-reduced-motion: reduce) {
    body.cf-theme *, body.cf-theme *::before { transition: none !important; animation: none !important; }
}

/* Onglets du module Finances */
body.cf-theme .finance-tab { border-radius: 7px; font-weight: 600; color: var(--cf-ink-2); }
body.cf-theme .finance-tab.active { background: var(--cf-teal) !important; color: #fff !important; }

/* Onglets Comptabilité et génériques injectés */
body.cf-theme .acc-tab { border-radius: 7px; font-weight: 600; color: var(--cf-ink-2); }
body.cf-theme .acc-tab.active { background: var(--cf-teal) !important; color: #fff !important; }

/* Cartes de chiffres du module Juridique (fond dégradé saturé en ligne) : version sobre */
body.cf-theme [style*="padding:20px;border-radius:12px;color:white;"] {
    background: var(--cf-panel) !important; color: var(--cf-ink) !important;
    border: 1px solid var(--cf-line); border-left-width: 3px;
}
body.cf-theme [style*="padding:20px;border-radius:12px;color:white;"][style*="#22c55e"] { border-left-color: var(--cf-green); }
body.cf-theme [style*="padding:20px;border-radius:12px;color:white;"][style*="#f59e0b"] { border-left-color: var(--cf-amber); }
body.cf-theme [style*="padding:20px;border-radius:12px;color:white;"][style*="#dc2626"] { border-left-color: var(--cf-red); }
body.cf-theme [style*="padding:20px;border-radius:12px;color:white;"][style*="#3b82f6"],
body.cf-theme [style*="padding:20px;border-radius:12px;color:white;"][style*="#8b5cf6"] { border-left-color: var(--cf-teal); }
body.cf-theme [style*="padding:20px;border-radius:12px;color:white;"] > div:last-child { color: var(--cf-ink-2); opacity: 1 !important; }

.cf-figures[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cf-figures[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 768px) {
    .cf-figures, .cf-figures[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cf-figure:nth-child(odd) { border-left: 0; }
    .cf-figure strong { font-size: 19px; }
}

/* Fenêtres du module Comptabilité (structure .modal-overlay > .modal) : elles étaient invisibles */
body.cf-theme .modal-overlay {
    position: fixed; inset: 0; z-index: 10000; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(22, 38, 43, .42);
}
body.cf-theme .modal-overlay > .modal {
    display: block; position: relative; inset: auto; width: 100%; height: auto; max-height: 90vh; max-height: calc(100dvh - 40px); overflow: auto;
    background: #fff; backdrop-filter: none; border: 1px solid var(--cf-line); border-radius: 12px; box-shadow: var(--cf-shadow-overlay);
}
body.cf-theme .modal-overlay > .modal input:not([type=checkbox]):not([type=radio]),
body.cf-theme .modal-overlay > .modal select, body.cf-theme .modal-overlay > .modal textarea { width: 100%; }

/* Facturation des médecins externes : réservée à l'administration et à la comptabilité */
body.cf-theme:not([data-role="admin"]):not([data-role="comptable"]) .tab-btn[onclick*="switchExternalTab('invoices'"],
body.cf-theme:not([data-role="admin"]):not([data-role="comptable"]) [onclick^="createInvoiceForRequest("] { display: none !important; }

/* Rapports : cartes de choix lisibles sur fond clair */
body.cf-theme .report-card { color: var(--cf-ink); text-align: left; padding: 18px 20px; cursor: pointer; }
body.cf-theme .report-card .report-icon {
    width: 40px; height: 40px; border-radius: 10px; font-size: 18px; opacity: 1; margin-bottom: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--cf-teal-wash); color: var(--cf-teal-strong);
}
body.cf-theme .report-card .report-title { color: var(--cf-ink); font-size: 16px; }
body.cf-theme .report-card .report-description { color: var(--cf-ink-2); opacity: 1; }

/* =============================================================================
   Téléphone (≤ 640 px) : tableaux en fiches, onglets défilants, fenêtres plein écran
   ============================================================================= */
.cf-demo-short { display: none; }
@media (max-width: 640px) {
    /* Bandeau démo : une ligne */
    #demoBanner { padding: 5px 12px !important; font-size: 12px !important; }
    #demoBanner .cf-demo-long { display: none; }
    #demoBanner .cf-demo-short { display: inline; }

    body.cf-theme .main-content { padding: 12px 12px 32px; }
    body.cf-theme .card { padding: 14px; border-radius: 10px; }
    body.cf-theme .card-header { flex-wrap: wrap; gap: 10px; }
    body.cf-theme .card-header h3, body.cf-theme .card-header h2 { font-size: 16px; }
    body.cf-theme .page-title { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
    body.cf-theme .user-role, body.cf-theme .user-name { display: none; }

    /* Chiffres clés : deux par ligne */
    body.cf-theme .stats-grid, body.cf-theme .finance-stats, body.cf-theme .kpi-grid, body.cf-theme #legalStats {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important;
    }
    body.cf-theme .stat-card, body.cf-theme .finance-stat-card, body.cf-theme .kpi-card { padding: 12px !important; min-width: 0; }
    body.cf-theme .stat-card .stat-value, body.cf-theme .kpi-value, body.cf-theme .finance-stat-card .stat-value { font-size: 17px !important; white-space: nowrap; }
    body.cf-theme .stat-card { gap: 8px; }
    body.cf-theme .stat-card .stat-card-value { font-size: 17px !important; white-space: nowrap; }
    body.cf-theme .stat-card .stat-card-icon { width: 34px !important; height: 34px !important; font-size: 15px !important; flex: 0 0 34px; }
    body.cf-theme .stat-card .stat-card-label { font-size: 12px; }
    body.cf-theme .stat-card > * { min-width: 0; }
    body.cf-theme .stat-card .stat-icon { width: 34px; height: 34px; font-size: 15px; }

    /* Onglets : une seule ligne qui défile */
    body.cf-theme .tabs-container, body.cf-theme .finance-tabs, body.cf-theme .accounting-tabs, body.cf-theme .acc-tabs {
        display: flex !important; flex-wrap: nowrap !important; overflow-x: auto; gap: 6px;
        -webkit-overflow-scrolling: touch; scrollbar-width: none; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px;
    }
    body.cf-theme .tabs-container::-webkit-scrollbar, body.cf-theme .finance-tabs::-webkit-scrollbar,
    body.cf-theme .accounting-tabs::-webkit-scrollbar { display: none; }
    body.cf-theme .tab-btn, body.cf-theme .finance-tab, body.cf-theme .acc-tab { flex: 0 0 auto; white-space: nowrap; min-height: 40px; }

    /* Tableaux : chaque ligne devient une fiche « libellé : valeur » */
    body.cf-theme table.cf-stack, body.cf-theme table.cf-stack tbody { display: block; width: 100%; }
    body.cf-theme table.cf-stack thead { display: none; }
    body.cf-theme table.cf-stack tr {
        display: block; background: var(--cf-panel); border: 1px solid var(--cf-line); border-radius: 10px;
        padding: 6px 12px; margin: 0 0 10px;
    }
    body.cf-theme table.cf-stack td {
        display: block; overflow: hidden; overflow-wrap: anywhere;
        padding: 7px 0 !important; border: 0 !important; border-bottom: 1px solid var(--cf-line-soft) !important;
        text-align: right; min-height: 0; white-space: normal !important; max-width: none !important; width: auto !important;
    }
    body.cf-theme table.cf-stack td > * { margin-left: auto; }
    body.cf-theme table.cf-stack td > div, body.cf-theme table.cf-stack td > span { max-width: 100%; }
    body.cf-theme table.cf-stack td:last-child { border-bottom: 0 !important; }
    body.cf-theme table.cf-stack td::before {
        content: attr(data-label); float: left; width: 38%; margin-right: 10px; text-align: left; line-height: 1.6;
        font-size: 12.5px; font-weight: 600; color: var(--cf-ink-3);
    }
    body.cf-theme table.cf-stack td:not([data-label])::before { content: none; }
    body.cf-theme table.cf-stack td:first-child { font-weight: 600; color: var(--cf-ink); }
    body.cf-theme table.cf-stack td.cf-cell-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding-top: 10px !important; }
    body.cf-theme table.cf-stack td.cf-cell-actions > * { margin-left: 0; }
    body.cf-theme table.cf-stack td.cf-cell-actions::before { content: none; }
    body.cf-theme table.cf-stack tr.cf-row-empty { border: 0; background: none; }
    body.cf-theme table.cf-stack tr.cf-row-empty td { display: block; text-align: center; }
    body.cf-theme table.cf-stack tr.cf-row-empty td::before { content: none; }
    body.cf-theme .table-container, body.cf-theme .table-responsive, body.cf-theme .data-table-wrapper { overflow: visible !important; border: 0 !important; background: none !important; }

    /* Cibles tactiles */
    body.cf-theme .action-btn, body.cf-theme .btn-icon { min-width: 40px; min-height: 40px; }
    body.cf-theme .btn { min-height: 40px; }
    body.cf-theme .btn-sm { min-height: 36px; }
    body.cf-theme input.form-control, body.cf-theme select.form-control, body.cf-theme textarea.form-control { font-size: 16px; } /* évite le zoom automatique sur iPhone */

    /* Fenêtres : plein écran, boutons toujours visibles en bas */
    body.cf-theme .modal, body.cf-theme .modal-overlay { padding: 0 !important; align-items: stretch !important; }
    body.cf-theme .modal .modal-content, body.cf-theme .modal-overlay > .modal, body.cf-theme .app-modal .modal-content {
        width: 100% !important; max-width: none !important; height: 100% !important; max-height: none !important;
        margin: 0 !important; border-radius: 0 !important; display: flex; flex-direction: column;
    }
    body.cf-theme .modal .modal-body, body.cf-theme .modal-overlay > .modal .modal-body { flex: 1; overflow-y: auto; max-height: none !important; }
    body.cf-theme .modal .modal-content { overflow-y: auto !important; }
    body.cf-theme .modal .modal-content > form { display: flex; flex-direction: column; flex: 1; min-height: 0; }
    body.cf-theme .modal .modal-footer, body.cf-theme .modal-overlay > .modal .modal-footer {
        position: sticky; bottom: 0; background: #fff; padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }
    body.cf-theme .modal .modal-footer .btn { flex: 1; }
    body.cf-theme .modal-content [style*="grid-template-columns"], body.cf-theme .modal-overlay [style*="grid-template-columns"],
    body.cf-theme .modal-content .form-row, body.cf-theme .modal-overlay .form-row { grid-template-columns: 1fr !important; display: grid; gap: 0 12px; }

    /* Agenda du jour : une colonne de praticien par largeur d'écran, défilement latéral */
    .cf-grid { scroll-snap-type: x mandatory; }
    .cf-grid > * { scroll-snap-align: start; }

    /* Rapports et bilans : une colonne */
    body.cf-theme .bilan-container, body.cf-theme .report-grid { grid-template-columns: 1fr !important; }
}

/* Appli installée : marge sous la barre d'état de l'iPhone */
@media (display-mode: standalone) {
    body.cf-theme .main-header { padding-top: max(10px, env(safe-area-inset-top)); }
}

/* Panneau des notifications : jamais hors de l'écran */
body.cf-theme #notifPanel { width: min(340px, calc(100vw - 24px)); }
@media (max-width: 640px) {
    body.cf-theme #notifPanel {
        position: fixed; top: 64px; left: 12px; right: 12px; width: auto; max-height: 70vh; overflow-y: auto;
    }
    body.cf-theme #userMenu { position: fixed; top: 64px; right: 12px; left: auto; max-width: calc(100vw - 24px); }
}

/* =============================================================================
   Fond de l'application : lumière douce et ondes calmes
   Base minérale légèrement chaude, halo sable en haut à gauche (lumière du matin),
   halo vert d'eau en bas à droite, ondes concentriques à peine visibles en haut à droite.
   Les cartes restent blanches : le fond ne touche jamais à la lisibilité des données.
   Image facultative : assets/img/fond-app.jpg (générée avec Canva). Absente, le dégradé s'affiche.
   ============================================================================= */
body.cf-theme { --cf-surface: #f2f4ef; }
body.cf-theme .main-wrapper {
    background:
        url("../img/fond-app.jpg") center / cover no-repeat,
        url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22720%22%20height%3D%22720%22%20viewBox%3D%220%200%20720%20720%22%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22120%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.20%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22172%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.18%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22224%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.16%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22276%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.14%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22328%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.12%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22380%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.10%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22432%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.08%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22484%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.06%22/%3E%3C/svg%3E") no-repeat right -200px top -220px / 820px 820px,
        radial-gradient(65% 70% at 0% 0%, rgba(233, 193, 150, .34), rgba(233, 193, 150, 0) 72%),
        radial-gradient(60% 55% at 100% 100%, rgba(28, 107, 104, .10), rgba(28, 107, 104, 0) 70%),
        linear-gradient(180deg, #f6f5f0 0%, #eef2ee 100%);
}
body.cf-theme .main-content { background: transparent; }
body.cf-theme .main-header { background: rgba(255, 255, 255, .86); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); }
body.cf-theme .card { box-shadow: 0 1px 2px rgba(22, 38, 43, .04); }
@media (max-width: 640px) {
    body.cf-theme .main-wrapper {
        background:
            url("../img/fond-app.jpg") 70% 0 / cover no-repeat,
            url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22720%22%20height%3D%22720%22%20viewBox%3D%220%200%20720%20720%22%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22120%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.20%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22172%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.18%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22224%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.16%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22276%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.14%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22328%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.12%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22380%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.10%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22432%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.08%22/%3E%3Ccircle%20cx%3D%22600%22%20cy%3D%22120%22%20r%3D%22484%22%20fill%3D%22none%22%20stroke%3D%22%231c6b68%22%20stroke-width%3D%221%22%20stroke-opacity%3D%220.06%22/%3E%3C/svg%3E") no-repeat right -330px top -300px / 600px 600px,
            radial-gradient(100% 45% at 0% 0%, rgba(233, 193, 150, .30), rgba(233, 193, 150, 0) 72%),
            radial-gradient(90% 40% at 100% 100%, rgba(28, 107, 104, .09), rgba(28, 107, 104, 0) 70%),
            linear-gradient(180deg, #f6f5f0 0%, #eef2ee 100%);
    }
}
@media (prefers-contrast: more) {
    body.cf-theme .main-wrapper { background: var(--cf-surface); }
}


/* =============================================================================
   Page d'accueil (clic sur le logo)
   ============================================================================= */
body.cf-theme button.sidebar-logo {
    background: none; border: 0; padding: 0; margin: 0; cursor: pointer; font: inherit; color: inherit; text-align: left;
    display: flex; align-items: center; gap: 10px; border-radius: 8px;
}
body.cf-theme button.sidebar-logo:hover span { color: var(--cf-teal-strong); }
body.cf-theme button.sidebar-logo span { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: var(--cf-ink); }
.cf-w-place[hidden] { display: none; }
.cf-w-today dd { text-align: right; }

.cf-welcome { max-width: 1180px; margin: 0 auto; }
.cf-w-hero {
    display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 28px; align-items: stretch;
    padding: 40px 40px 36px; border-radius: 16px; border: 1px solid var(--cf-line);
    background:
        linear-gradient(90deg, rgba(255, 255, 255, .94) 0%, rgba(255, 255, 255, .80) 48%, rgba(255, 255, 255, .35) 100%),
        url("../img/fond-app.jpg") right top / cover no-repeat,
        linear-gradient(120deg, #fbfaf6 0%, #eaf2ef 100%);
    margin-bottom: 28px;
}
.cf-w-identity { display: flex; align-items: center; gap: 14px; margin: 0 0 22px; padding: 0 0 18px; border-bottom: 1px solid var(--cf-line-soft); }
.cf-w-identity.is-empty { display: none; }
.cf-w-mark {
    flex: 0 0 56px; width: 56px; height: 56px; border-radius: 14px; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--cf-teal); color: #fff; font-weight: 700; font-size: 20px; letter-spacing: .03em;
}
.cf-w-mark.has-logo { background: #fff; box-shadow: inset 0 0 0 1px var(--cf-line); }
.cf-w-mark img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cf-w-id-text { min-width: 0; }
.cf-w-clinic { margin: 0; font-size: clamp(20px, 2.1vw, 26px); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; color: var(--cf-teal-strong); overflow-wrap: anywhere; }
.cf-w-who { margin: 4px 0 0; font-size: 13.5px; color: var(--cf-ink-3); }
.cf-w-hero h1 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 36px); line-height: 1.1; letter-spacing: -0.02em; color: var(--cf-ink); }
.cf-w-lead { margin: 0 0 24px; max-width: 58ch; font-size: 16px; line-height: 1.55; color: var(--cf-ink-2); }
.cf-w-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cf-w-actions .btn { min-height: 44px; padding: 0 18px; font-size: 14.5px; }

.cf-w-today {
    align-self: center; background: rgba(255, 255, 255, .92); border: 1px solid var(--cf-line); border-radius: 12px;
    padding: 18px 20px; box-shadow: 0 8px 24px rgba(22, 38, 43, .06);
}
.cf-w-today-date { margin: 0 0 12px; font-weight: 700; color: var(--cf-ink); }
.cf-w-today dl { margin: 0; }
.cf-w-today dl > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--cf-line-soft); }
.cf-w-today dt { color: var(--cf-ink-2); font-size: 13.5px; }
.cf-w-today dd { margin: 0; font-size: 20px; font-weight: 700; color: var(--cf-teal-strong); font-variant-numeric: tabular-nums; }

.cf-w-section { margin-bottom: 28px; }
.cf-w-section h2 { margin: 0 0 6px; font-size: 18px; }
.cf-w-sub { margin: 0 0 14px; color: var(--cf-ink-2); }
.cf-w-section > h2 + .cf-w-spaces { margin-top: 12px; }
.cf-w-spaces { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.cf-w-space {
    display: flex; gap: 12px; align-items: flex-start; text-align: left; cursor: pointer; font: inherit; color: inherit;
    background: #fff; border: 1px solid var(--cf-line); border-radius: 12px; padding: 14px 16px; transition: border-color .12s, box-shadow .12s;
}
.cf-w-space:hover { border-color: var(--cf-teal); box-shadow: 0 4px 14px rgba(28, 107, 104, .08); }
.cf-w-space strong { display: block; color: var(--cf-ink); margin-bottom: 2px; }
.cf-w-space span span { color: var(--cf-ink-2); font-size: 13px; line-height: 1.4; }
.cf-w-space-icon {
    flex: 0 0 36px; width: 36px; height: 36px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--cf-teal-wash); color: var(--cf-teal-strong);
}

.cf-w-steps { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid var(--cf-line); border-radius: 12px; }
.cf-w-step { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--cf-line-soft); }
.cf-w-step:first-child { border-top: 0; }
.cf-w-step-num {
    width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--cf-teal); color: var(--cf-teal-strong); font-weight: 700; font-size: 13px;
}
.cf-w-step strong { color: var(--cf-ink); }
.cf-w-step p { margin: 2px 0 0; color: var(--cf-ink-2); font-size: 13.5px; }
.cf-w-foot { color: var(--cf-ink-3); font-size: 13px; display: flex; gap: 8px; align-items: center; margin: 0 0 12px; }

@media (max-width: 860px) {
    .cf-w-hero { grid-template-columns: 1fr; padding: 24px 20px; gap: 20px; }
    .cf-w-hero { background:
        linear-gradient(180deg, rgba(255, 255, 255, .90) 0%, rgba(255, 255, 255, .78) 100%),
        url("../img/fond-app.jpg") 75% top / cover no-repeat,
        linear-gradient(120deg, #fbfaf6 0%, #eaf2ef 100%); }
    .cf-w-actions .btn { flex: 1 1 100%; justify-content: center; }
    .cf-w-step { grid-template-columns: 30px minmax(0, 1fr); }
    .cf-w-step .btn { grid-column: 2; justify-self: start; }
}

/* Menu latéral ouvert sur téléphone ou tablette en portrait : au-dessus de l'en-tête (le logo restait masqué) */
@media (max-width: 768px), (max-width: 1100px) and (orientation: portrait) {
    body.cf-theme .sidebar { z-index: 1200; top: 0; height: 100%; box-shadow: var(--cf-shadow-overlay); }
    body.cf-theme .sidebar:not(.open) { box-shadow: none; }
    body.cf-theme .sidebar-overlay { z-index: 1150; }
}

/* Page d'accueil : la photo (assets/img/accueil.jpg) occupe toute la moitié droite du bandeau,
   fondue vers le texte ; la carte « Aujourd'hui » est posée sur son bord gauche */
.cf-w-visual { position: relative; align-self: center; }
.cf-w-photo { display: none; margin: 0; }
.cf-w-hero.has-photo {
    position: relative; overflow: hidden; isolation: isolate;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 440px; padding: 48px 44px;
}
.cf-w-hero.has-photo .cf-w-hero-text { position: relative; z-index: 2; align-self: center; }
.cf-w-hero.has-photo .cf-w-photo {
    display: block; position: absolute; z-index: 0; top: 0; right: 0; bottom: 0; width: 56%;
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 22%); mask-image: linear-gradient(90deg, transparent 0%, #000 22%);
}
.cf-w-hero.has-photo .cf-w-photo img { width: 100%; height: 100%; object-fit: cover; object-position: 62% 28%; display: block; }
.cf-w-hero.has-photo .cf-w-visual { position: static; align-self: end; z-index: 2; }
.cf-w-hero.has-photo .cf-w-today { position: relative; width: min(290px, 100%); margin-bottom: -8px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); background: rgba(255, 255, 255, .9); }
@media (max-width: 860px) {
    .cf-w-hero.has-photo { grid-template-columns: 1fr; min-height: 0; padding: 0 0 20px; }
    .cf-w-hero.has-photo .cf-w-photo {
        position: relative; width: 100%; height: 240px; order: -1;
        -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 70%, transparent 100%);
    }
    .cf-w-hero.has-photo { display: flex; flex-direction: column; }
    .cf-w-hero.has-photo .cf-w-hero-text { padding: 0 20px; margin-top: -8px; }
    .cf-w-hero.has-photo .cf-w-visual { padding: 0 20px; align-self: stretch; }
    .cf-w-hero.has-photo .cf-w-today { width: auto; margin: 4px 0 0; }
}
.cf-w-today dd, .cf-w-today dt { white-space: nowrap; }
/* Avec photo, sur grand écran : la carte « Aujourd'hui » passe à gauche, sous les boutons, en une ligne de trois chiffres */
@media (min-width: 861px) {
    .cf-w-hero.has-photo { grid-template-rows: auto auto; align-content: center; row-gap: 26px; }
    .cf-w-hero.has-photo .cf-w-hero-text { grid-column: 1; grid-row: 1; }
    .cf-w-hero.has-photo .cf-w-visual { grid-column: 1; grid-row: 2; align-self: start; }
    .cf-w-hero.has-photo .cf-w-today { width: auto; max-width: 560px; margin: 0; padding: 14px 18px; }
    .cf-w-hero.has-photo .cf-w-today-date { margin-bottom: 8px; font-size: 13.5px; }
    .cf-w-hero.has-photo .cf-w-today dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
    .cf-w-hero.has-photo .cf-w-today dl > div {
        flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; gap: 2px;
        padding: 8px 14px; border-top: 1px solid var(--cf-line-soft); border-left: 1px solid var(--cf-line-soft);
    }
    .cf-w-hero.has-photo .cf-w-today dl > div:first-child { border-left: 0; padding-left: 0; }
    .cf-w-hero.has-photo .cf-w-today dt { font-size: 12.5px; white-space: normal; }
    .cf-w-hero.has-photo .cf-w-today dd { text-align: left; font-size: 22px; }
}

/* =============================================================================
   Identité de l'établissement (barre latérale, en-tête) et photos de profil
   ============================================================================= */
body.cf-theme .sidebar-header { padding: 14px 14px 13px; }
body.cf-theme .cf-establishment {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px; margin: 0;
    background: none; border: 0; border-radius: 10px; cursor: pointer; text-align: left; font: inherit; color: inherit;
}
body.cf-theme .cf-establishment:hover { background: var(--cf-surface); }
body.cf-theme .cf-establishment:focus-visible { outline: 2px solid var(--cf-teal); outline-offset: 2px; }
body.cf-theme .cf-est-mark {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 11px; overflow: hidden;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--cf-teal); color: #fff; font-weight: 700; font-size: 16px; letter-spacing: .03em;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
body.cf-theme .cf-est-mark:has(img) { background: #fff; box-shadow: inset 0 0 0 1px var(--cf-line); }
body.cf-theme .cf-est-mark img { width: 100%; height: 100%; object-fit: contain; padding: 3px; }
body.cf-theme .cf-est-text { display: flex; flex-direction: column; min-width: 0; }
body.cf-theme .cf-est-name {
    font-size: 15px; font-weight: 700; line-height: 1.22; color: var(--cf-ink); letter-spacing: -0.005em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
body.cf-theme .cf-est-app { font-size: 11.5px; font-weight: 500; color: var(--cf-ink-3); margin-top: 2px; }

body.cf-theme .cf-title-stack { display: flex; flex-direction: column; min-width: 0; }
body.cf-theme .cf-header-clinic { display: none; font-size: 12px; font-weight: 600; color: var(--cf-teal-strong); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 60vw; }
@media (max-width: 768px) { body.cf-theme .cf-header-clinic { display: block; } }

body.cf-theme .cf-avatar { overflow: hidden; flex-shrink: 0; }
body.cf-theme .cf-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
body.cf-theme .user-btn .user-avatar { width: 34px; height: 34px; border-radius: 50%; font-size: 14px; }

/* Photo de profil (Mon profil) */
body.cf-theme .cf-photo-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
body.cf-theme .cf-photo-big {
    width: 88px; height: 88px; border-radius: 50%; background: var(--cf-teal); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-size: 34px; font-weight: 700;
    box-shadow: 0 0 0 4px var(--cf-panel), 0 0 0 5px var(--cf-line);
}
body.cf-theme .cf-photo-actions { display: flex; flex-direction: column; gap: 8px; }
body.cf-theme .cf-photo-actions .cf-photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
body.cf-theme .cf-photo-hint { font-size: 12px; color: var(--cf-ink-3); margin: 0; }
body.cf-theme .cf-logo-preview {
    width: 120px; height: 72px; border-radius: 10px; border: 1px dashed var(--cf-line); background: #fff;
    display: inline-flex; align-items: center; justify-content: center; color: var(--cf-ink-3); font-size: 12px; overflow: hidden;
}
body.cf-theme .cf-logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 6px; }

/* Petites photos dans les listes */
body.cf-theme .cf-mini-avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--cf-teal-wash); color: var(--cf-teal-strong);
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
    vertical-align: middle; margin-right: 10px; overflow: hidden;
}
body.cf-theme .cf-mini-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Fonctions expérimentales dans le menu */
body.cf-theme .cf-nav-beta { margin-left: auto; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; color: #7a4b00; background: #fff4d6; border: 1px solid #f1c76b; border-radius: 999px; padding: 1px 7px; line-height: 1.5; }
body.cf-theme .nav-item.active .cf-nav-beta { background: #fff; }

/* =============================================================================
   Vue patient et accueil : cartes « dossier » (en-tête avec photo, onglets, grille de cartes)
   ============================================================================= */
body.cf-theme .pv { display: grid; gap: 18px; }
body.cf-theme .pv-back { justify-self: start; background: none; border: 0; color: var(--cf-teal); font: inherit; font-weight: 600; padding: 4px 0; cursor: pointer; }
body.cf-theme .pv-back:hover { text-decoration: underline; }
body.cf-theme .pv-head {
    background: #fff; border: 1px solid var(--cf-line); border-radius: 16px; padding: 22px 24px 0;
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 20px; box-shadow: 0 1px 2px rgba(22,38,43,.04);
}
body.cf-theme .pv-id { display: flex; gap: 18px; align-items: center; min-width: 0; }
body.cf-theme .pv-photo {
    position: relative; width: 84px; height: 84px; flex: 0 0 84px; border-radius: 50%; overflow: hidden; border: 3px solid var(--cf-teal-wash);
    background: var(--cf-teal); color: #fff; font-size: 28px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
body.cf-theme .pv-photo img { width: 100%; height: 100%; object-fit: cover; }
body.cf-theme .pv-photo i { position: absolute; inset: auto 0 0 0; height: 26px; line-height: 26px; font-size: 12px; background: rgba(22,38,43,.55); opacity: 0; transition: opacity .15s; }
body.cf-theme .pv-photo:hover i, body.cf-theme .pv-photo:focus-visible i { opacity: 1; }
body.cf-theme .pv-photo:focus-visible { outline: 3px solid rgba(28,107,104,.4); outline-offset: 2px; }
body.cf-theme .pv-who { min-width: 0; }
body.cf-theme .pv-who h2 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -0.015em; color: var(--cf-ink); }
body.cf-theme .pv-meta { margin: 4px 0 10px; color: var(--cf-ink-2); font-size: 14px; }
body.cf-theme .pv-tags { display: flex; flex-wrap: wrap; gap: 6px; }
body.cf-theme .pv-tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--cf-surface); border: 1px solid var(--cf-line); font-size: 12.5px; color: var(--cf-ink-2); }
body.cf-theme .pv-tag-red { background: var(--cf-red-wash); border-color: #f3c7c2; color: var(--cf-red); font-weight: 600; }
body.cf-theme .pv-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; justify-content: flex-end; }
body.cf-theme .pv-actions .btn { white-space: nowrap; }
body.cf-theme .pv-tabs { grid-column: 1 / -1; display: flex; gap: 4px; overflow-x: auto; border-top: 1px solid var(--cf-line); margin: 0 -24px; padding: 0 16px; scrollbar-width: thin; }
body.cf-theme .pv-tabs button {
    background: none; border: 0; border-bottom: 3px solid transparent; padding: 13px 12px 11px; font: inherit; font-size: 14px; font-weight: 600;
    color: var(--cf-ink-3); cursor: pointer; white-space: nowrap;
}
body.cf-theme .pv-tabs button:hover { color: var(--cf-ink); }
body.cf-theme .pv-tabs button[aria-selected="true"] { color: var(--cf-teal); border-bottom-color: var(--cf-teal); }
body.cf-theme .pv-tabs button:focus-visible { outline: 2px solid var(--cf-teal); outline-offset: -2px; }
body.cf-theme .pv-alert { background: var(--cf-amber-wash); color: #6b4200; border: 1px solid #f1d08f; border-radius: 12px; padding: 10px 14px; font-size: 14px; }
body.cf-theme .pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 16px; align-items: start; }
body.cf-theme .pv-card { background: #fff; border: 1px solid var(--cf-line); border-radius: 16px; padding: 18px 20px; box-shadow: 0 1px 2px rgba(22,38,43,.04); min-width: 0; }
body.cf-theme .pv-wide { grid-column: 1 / -1; }
body.cf-theme .pv-card > header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
body.cf-theme .pv-card > header h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--cf-ink); flex: 1; }
body.cf-theme .pv-chip { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }
body.cf-theme .pv-teal { background: var(--cf-teal-wash); color: var(--cf-teal); }
body.cf-theme .pv-blue { background: var(--cf-blue-wash); color: var(--cf-blue); }
body.cf-theme .pv-amber { background: var(--cf-amber-wash); color: var(--cf-amber); }
body.cf-theme .pv-green { background: var(--cf-green-wash); color: var(--cf-green); }
body.cf-theme .pv-red { background: var(--cf-red-wash); color: var(--cf-red); }
body.cf-theme .pv-violet { background: #efeafa; color: #5b3f9e; }
body.cf-theme .pv-link { background: none; border: 0; color: var(--cf-teal); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
body.cf-theme .pv-link:hover { background: var(--cf-teal-wash); }
body.cf-theme .pv-list { list-style: none; margin: 0; padding: 0; }
body.cf-theme .pv-list li { padding: 9px 0; border-top: 1px solid #edf1f0; }
body.cf-theme .pv-list li:first-child { border-top: 0; padding-top: 2px; }
body.cf-theme .pv-l1 { margin: 0; font-weight: 600; font-size: 14px; color: var(--cf-ink); overflow-wrap: anywhere; }
body.cf-theme .pv-l2 { margin: 2px 0 0; font-size: 13px; color: var(--cf-ink-3); overflow-wrap: anywhere; }
body.cf-theme .pv-l1 a { color: var(--cf-teal); }
body.cf-theme .pv-empty { margin: 4px 0; color: var(--cf-ink-3); font-size: 14px; }
body.cf-theme .pv-sub { margin: 10px 0 0; font-size: 13px; color: var(--cf-ink-3); }
body.cf-theme .pv-dot-red { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cf-red); margin-right: 6px; vertical-align: middle; }
body.cf-theme .pv-timeline { list-style: none; margin: 0; padding: 0; position: relative; }
body.cf-theme .pv-timeline li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 0 0 16px; position: relative; }
body.cf-theme .pv-timeline li::before { content: ''; position: absolute; left: 17px; top: 36px; bottom: 0; width: 2px; background: #e6ecea; }
body.cf-theme .pv-timeline li:last-child::before { display: none; }
body.cf-theme .pv-tl-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--cf-teal-wash); color: var(--cf-teal); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
body.cf-theme .pv-tl-date { margin: 0; font-size: 12.5px; color: var(--cf-ink-3); }
body.cf-theme .pv-tl-title { margin: 2px 0 0; font-weight: 600; color: var(--cf-ink); }
body.cf-theme .pv-tl-text { margin: 3px 0 0; color: var(--cf-ink-2); font-size: 14px; overflow-wrap: anywhere; }
body.cf-theme .pv-pre { white-space: pre-wrap; }
body.cf-theme .pv-table { overflow-x: auto; }
body.cf-theme .pv-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
body.cf-theme .pv-table th { text-align: left; font-size: 12.5px; color: var(--cf-ink-3); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--cf-line); }
body.cf-theme .pv-table td { padding: 10px; border-bottom: 1px solid #edf1f0; vertical-align: top; }
body.cf-theme .pv-table small { color: var(--cf-ink-3); }
body.cf-theme .pv-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; background: var(--cf-surface); color: var(--cf-ink-3); }
body.cf-theme .pv-status.is-on { background: var(--cf-green-wash); color: var(--cf-green); }
body.cf-theme .pv-form { display: grid; gap: 8px; }
body.cf-theme .pv-form label { font-weight: 600; font-size: 13.5px; margin-top: 6px; }
body.cf-theme .pv-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body.cf-theme .pv-modal .modal { max-width: 560px; width: calc(100% - 32px); }
@media (max-width: 760px) {
    body.cf-theme .pv-head { grid-template-columns: 1fr; padding: 18px 16px 0; }
    body.cf-theme .pv-tabs { margin: 0 -16px; padding: 0 8px; }
    body.cf-theme .pv-actions { justify-content: flex-start; }
    body.cf-theme .pv-photo { width: 68px; height: 68px; flex-basis: 68px; font-size: 22px; }
    body.cf-theme .pv-who h2 { font-size: 20px; }
    body.cf-theme .pv-2 { grid-template-columns: 1fr; }
}
/* Accueil */
body.cf-theme .cf-home .pv-photo { cursor: pointer; }
body.cf-theme .pv-tag-amber { background: var(--cf-amber-wash); border-color: #f1d08f; color: #7a4b00; font-weight: 600; }
body.cf-theme .cf-h-click { cursor: pointer; border-radius: 8px; margin: 0 -8px; padding-left: 8px !important; padding-right: 8px !important; }
body.cf-theme .cf-h-click:hover { background: var(--cf-surface); }
body.cf-theme .cf-h-click:focus-visible { outline: 2px solid var(--cf-teal); }
body.cf-theme .cf-h-allergy { color: var(--cf-red); font-weight: 600; }
body.cf-theme .cf-h-space { display: flex; gap: 14px; align-items: flex-start; text-align: left; font: inherit; cursor: pointer; }
body.cf-theme .cf-h-space:hover { border-color: var(--cf-teal); }
body.cf-theme .cf-h-space:focus-visible { outline: 3px solid rgba(28,107,104,.35); outline-offset: 2px; }
body.cf-theme .cf-h-space strong { display: block; color: var(--cf-ink); font-size: 15px; margin-bottom: 2px; }
body.cf-theme .cf-h-space span span { color: var(--cf-ink-3); font-size: 13.5px; }
@media (max-width: 600px) {
  body.cf-theme .cf-home .pv-id { align-items: flex-start; }
  body.cf-theme .cf-home .pv-photo { width: 56px; height: 56px; font-size: 22px; flex: 0 0 56px; }
  body.cf-theme .cf-home .pv-who h2 { font-size: 22px; }
}

/* =============================================================================
   Cadre vert : barre latérale, en-tête et bandeau de démonstration
   ============================================================================= */
body.cf-theme { --cf-frame: #17564f; --cf-frame-2: #0f4440; --cf-frame-ink: #f2f8f6; --cf-frame-ink-2: #b9d3cd; --cf-frame-line: rgba(255,255,255,.12); }
body.cf-theme .sidebar {
    background: linear-gradient(180deg, var(--cf-frame) 0%, var(--cf-frame-2) 100%);
    color: var(--cf-frame-ink); border-right: 0;
}
body.cf-theme .sidebar-header { border-bottom-color: var(--cf-frame-line); }
body.cf-theme .cf-establishment:hover { background: rgba(255,255,255,.08); }
body.cf-theme .cf-establishment:focus-visible { outline-color: #9fd8cc; }
body.cf-theme .cf-est-mark { background: #fff; color: var(--cf-frame); box-shadow: none; }
body.cf-theme .cf-est-name { color: #fff; }
body.cf-theme .cf-est-app { color: var(--cf-frame-ink-2); }
body.cf-theme .nav-section-title { color: #8fb8af; }
body.cf-theme .nav-item { color: #dcebe7; }
body.cf-theme .nav-item i { color: #a9cbc3; }
body.cf-theme .nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
body.cf-theme .nav-item:hover i { color: #fff; }
body.cf-theme .nav-item:focus-visible { outline: 2px solid #9fd8cc; outline-offset: -2px; }
body.cf-theme .nav-item.active { background: #fff; color: var(--cf-frame-2); }
body.cf-theme .nav-item.active i { color: var(--cf-teal); }
body.cf-theme .nav-item.active::before { background: #e9c196; }
body.cf-theme .sidebar ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); }
body.cf-theme .sidebar { scrollbar-color: rgba(255,255,255,.25) transparent; }

body.cf-theme .main-header {
    background: linear-gradient(90deg, var(--cf-frame) 0%, #1c6b62 100%);
    backdrop-filter: none; -webkit-backdrop-filter: none; border-bottom: 0;
    box-shadow: 0 1px 0 rgba(0,0,0,.06), 0 4px 14px rgba(15,68,64,.12);
}
body.cf-theme .main-header .page-title { color: #fff; }
body.cf-theme .main-header .cf-header-clinic { color: #cfe6e0; }
body.cf-theme .main-header .menu-toggle { color: #fff; }
body.cf-theme .main-header .notification-btn,
body.cf-theme .main-header .user-btn { border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.06); color: #fff; }
body.cf-theme .main-header .notification-btn:hover,
body.cf-theme .main-header .user-btn:hover { background: rgba(255,255,255,.16); }
body.cf-theme .main-header .notification-btn > i,
body.cf-theme .main-header .user-chevron { color: #fff; }
body.cf-theme .main-header .user-btn .user-name { color: #fff; }
body.cf-theme .main-header .user-btn .user-role { color: var(--cf-frame-ink-2); }
body.cf-theme .main-header .user-btn .user-avatar { background: #fff; color: var(--cf-frame); }
body.cf-theme .main-header .notification-badge { box-shadow: 0 0 0 2px var(--cf-frame); }

body.cf-theme #demoBanner {
    background: var(--cf-frame-2) !important; color: #e3efec !important;
    border-bottom: 1px solid rgba(255,255,255,.10) !important;
}
body.cf-theme #demoBanner strong { color: #f5c97a; }
@media (prefers-contrast: more) {
    body.cf-theme .sidebar, body.cf-theme .main-header, body.cf-theme #demoBanner { background: #0d3d39 !important; }
    body.cf-theme .nav-item, body.cf-theme .nav-section-title { color: #fff; }
}
body.cf-theme .main-header .user-btn .user-info { background: transparent; }
body.cf-theme .pv-tag[hidden] { display: none; }
@media (max-width: 768px), (max-width: 1100px) and (orientation: portrait) {
    body.cf-theme .sidebar { z-index: 10001; }
    body.cf-theme .sidebar-overlay { z-index: 10000; }
}

/* =============================================================================
   Horloge de l'en-tête (heure de l'établissement ou d'une autre ville)
   ============================================================================= */
body.cf-theme .cf-clock { position: relative; margin-right: 6px; }
body.cf-theme .cf-clock-btn {
    display: flex; flex-direction: column; align-items: flex-end; gap: 1px; padding: 5px 12px; min-height: 44px; justify-content: center;
    background: transparent; border: 1px solid transparent; border-radius: 10px; color: #fff; font: inherit; cursor: pointer; text-align: right;
}
body.cf-theme .cf-clock-btn:hover, body.cf-theme .cf-clock-btn[aria-expanded="true"] { background: rgba(255,255,255,.10); border-color: rgba(255,255,255,.22); }
body.cf-theme .cf-clock-btn:focus-visible { outline: 2px solid #9fd8cc; outline-offset: 2px; }
body.cf-theme .cf-clock-time { font-size: 21px; font-weight: 700; line-height: 1.1; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
body.cf-theme .cf-clock-sub { font-size: 12px; color: #cfe6e0; white-space: nowrap; }
body.cf-theme .cf-clock-sub i { font-size: 10.5px; margin-left: 2px; }
body.cf-theme .cf-clock.is-other .cf-clock-sub i, body.cf-theme .cf-clock.is-other #cfClockCity { color: #f5c97a; font-weight: 600; }
body.cf-theme .cf-clock-panel {
    position: absolute; right: 0; top: calc(100% + 8px); width: 330px; max-width: calc(100vw - 24px); z-index: 1300;
    background: #fff; color: var(--cf-ink); border: 1px solid var(--cf-line); border-radius: 12px; box-shadow: var(--cf-shadow-overlay); padding: 12px;
}
body.cf-theme .cf-clock-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
body.cf-theme .cf-clock-head strong { font-size: 15px; }
body.cf-theme .cf-clock-x { background: none; border: 0; width: 32px; height: 32px; border-radius: 8px; color: var(--cf-ink-3); cursor: pointer; }
body.cf-theme .cf-clock-x:hover { background: var(--cf-surface); color: var(--cf-ink); }
body.cf-theme .cf-clock-search { width: 100%; padding: 9px 11px; border: 1px solid var(--cf-line); border-radius: 8px; font: inherit; font-size: 14px; }
body.cf-theme .cf-clock-search:focus { outline: 2px solid var(--cf-teal); outline-offset: -1px; border-color: var(--cf-teal); }
body.cf-theme .cf-clock-home {
    display: flex; align-items: center; gap: 10px; width: 100%; margin: 8px 0 6px; padding: 8px 10px; text-align: left;
    background: var(--cf-teal-wash); border: 0; border-radius: 8px; color: var(--cf-teal-strong); font: inherit; cursor: pointer;
}
body.cf-theme .cf-clock-home:hover { background: #d5e8e4; }
body.cf-theme .cf-clock-home > span:first-of-type { display: flex; flex-direction: column; flex: 1; min-width: 0; }
body.cf-theme .cf-clock-home small { font-size: 12px; color: var(--cf-ink-2); }
body.cf-theme .cf-clock-list { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; }
body.cf-theme .cf-clock-list li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; }
body.cf-theme .cf-clock-list li:hover, body.cf-theme .cf-clock-list li.is-active { background: var(--cf-surface); }
body.cf-theme .cf-clock-list li.is-current { font-weight: 700; color: var(--cf-teal-strong); }
body.cf-theme .cf-clock-list li.cf-clock-none { cursor: default; color: var(--cf-ink-3); }
body.cf-theme .cf-clock-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.cf-theme .cf-clock-o { font-size: 12px; color: var(--cf-ink-3); }
body.cf-theme .cf-clock-t { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 42px; text-align: right; }
@media (max-width: 1100px) { body.cf-theme .cf-clock-sub .cf-clock-sep, body.cf-theme #cfClockDate { display: none; } }
@media (max-width: 768px) {
    body.cf-theme .cf-clock { margin-right: 2px; }
    body.cf-theme .cf-clock-btn { padding: 4px 6px; }
    body.cf-theme .cf-clock-time { font-size: 16px; }
    body.cf-theme .cf-clock-sub { font-size: 11px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
    body.cf-theme .cf-clock-panel { position: fixed; left: 12px; right: 12px; top: 70px; width: auto; }
}
@media (max-width: 340px) { body.cf-theme .cf-clock-sub { display: none; } }
@media (max-width: 768px) {
    body.cf-theme .main-header .header-left { flex: 1 1 auto; min-width: 0; }
    body.cf-theme .main-header .cf-title-stack { min-width: 0; }
    body.cf-theme .main-header .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    body.cf-theme .main-header .cf-header-clinic { max-width: 100%; }
    body.cf-theme .main-header .header-right { flex: 0 0 auto; gap: 6px; }
}
@media (max-width: 480px) {
    body.cf-theme .cf-clock-time { font-size: 15px; }
    body.cf-theme .main-header .user-chevron { display: none; }
}

/* =============================================================================
   Style « tableau de bord coloré » : tuiles de couleur, profil dans le menu,
   bandes de section, en-tête turquoise, pied de page
   ============================================================================= */
body.cf-theme { --cf-frame: #123f3c; --cf-frame-2: #0c302e; --cf-head: #0f7f78; --cf-head-2: #12958c; }
body.cf-theme .sidebar { background: var(--cf-frame); }
body.cf-theme .sidebar-header { background: var(--cf-frame-2); border-bottom: 0; }

/* Profil dans le menu */
body.cf-theme .cf-user-panel { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--cf-frame-line); }
body.cf-theme .cf-user-panel-photo {
    flex: 0 0 46px; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--cf-frame);
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700;
    box-shadow: 0 0 0 2px rgba(255,255,255,.25);
}
body.cf-theme .cf-user-panel-text { display: flex; flex-direction: column; min-width: 0; }
body.cf-theme .cf-user-panel-text strong { color: #fff; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.cf-theme .cf-user-panel-text span { color: var(--cf-frame-ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.cf-theme .cf-user-panel-text .fa-circle { color: #4ade80; font-size: 8px; vertical-align: 1px; margin-right: 2px; }

/* Bandes de section et élément actif */
body.cf-theme .sidebar-nav { padding: 0 0 16px; }
body.cf-theme .nav-section { margin-bottom: 4px; }
body.cf-theme .nav-section-title {
    background: var(--cf-frame-2); color: #9cc3ba; font-size: 11px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; padding: 8px 18px; margin-bottom: 4px;
}
body.cf-theme .nav-item { border-radius: 0; margin: 0; padding: 10px 18px; border-left: 3px solid transparent; }
body.cf-theme .nav-item.active { background: rgba(255,255,255,.10); color: #fff; border-left-color: #2dd4bf; }
body.cf-theme .nav-item.active i { color: #5eead4; }
body.cf-theme .nav-item.active::before { display: none; }
body.cf-theme .nav-item.active .cf-nav-beta { background: #fff4d6; }

/* En-tête turquoise et sous-titre */
body.cf-theme .main-header { background: linear-gradient(90deg, var(--cf-head) 0%, var(--cf-head-2) 100%); }
body.cf-theme #demoBanner { background: var(--cf-frame-2) !important; }
body.cf-theme .cf-title-stack { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
body.cf-theme .cf-page-sub { color: #c8ece7; font-size: 13.5px; font-weight: 500; }
@media (max-width: 768px) {
    body.cf-theme .cf-title-stack { flex-direction: column; align-items: flex-start; gap: 0; flex-wrap: nowrap; }
    body.cf-theme .cf-page-sub { display: none; }
}

/* Tuiles de couleur (tableau de bord) */
body.cf-theme .cf-figures {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px;
    background: none; border: 0; border-radius: 0; overflow: visible; margin-bottom: 22px;
}
body.cf-theme .cf-tile {
    position: relative; display: flex; flex-direction: column; justify-content: space-between; min-height: 118px; overflow: hidden;
    padding: 0; border: 0 !important; border-radius: 6px; color: #fff; text-align: left; font: inherit;
    box-shadow: 0 1px 2px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
}
body.cf-theme button.cf-tile { cursor: pointer; }
body.cf-theme div.cf-tile { cursor: default; }
body.cf-theme .cf-tile-body { display: block; padding: 14px 16px 10px; position: relative; z-index: 1; }
body.cf-theme .cf-tile-body strong { display: block; font-size: 30px; font-weight: 800; line-height: 1.1; color: #fff; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
body.cf-theme .cf-tile-body span { display: block; font-size: 14px; color: rgba(255,255,255,.92); margin-top: 4px; }
body.cf-theme .cf-tile-icon { position: absolute; right: 14px; top: 12px; font-size: 60px; color: rgba(0,0,0,.16); transition: transform .2s ease; }
body.cf-theme button.cf-tile:hover .cf-tile-icon { transform: scale(1.08); }
body.cf-theme .cf-tile-more {
    display: block; text-align: center; padding: 5px 8px; font-size: 13px; color: rgba(255,255,255,.92);
    background: rgba(0,0,0,.12); position: relative; z-index: 1; min-height: 28px;
}
body.cf-theme button.cf-tile:hover .cf-tile-more { background: rgba(0,0,0,.2); color: #fff; }
body.cf-theme button.cf-tile:focus-visible { outline: 3px solid #0f7f78; outline-offset: 2px; }
body.cf-theme .cf-tile-teal   { background: #0f766e; }
body.cf-theme .cf-tile-amber  { background: #b45309; }
body.cf-theme .cf-tile-blue   { background: #1d5fa8; }
body.cf-theme .cf-tile-green  { background: #15803d; }
body.cf-theme .cf-tile-violet { background: #6d3fc0; }
body.cf-theme .cf-tile-orange { background: #c2410c; }
body.cf-theme .cf-tile-red    { background: #b91c1c; }
body.cf-theme .cf-tile-cyan   { background: #0e7490; }
@media (max-width: 1100px) { body.cf-theme .cf-figures { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 768px) {
    body.cf-theme .cf-figures { gap: 10px; }
    body.cf-theme .cf-figure:nth-child(n+3) { border-top: 0; }
    body.cf-theme .cf-tile { min-height: 100px; }
    body.cf-theme .cf-tile-body strong { font-size: 24px; }
    body.cf-theme .cf-tile-body span { font-size: 13px; }
    body.cf-theme .cf-tile-icon { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { body.cf-theme .cf-tile-icon { transition: none; } }

/* Pied de page */
body.cf-theme .cf-footer {
    flex-shrink: 0; display: flex; justify-content: space-between; gap: 12px; padding: 9px 28px;
    background: #fff; border-top: 1px solid var(--cf-line); font-size: 12.5px; color: var(--cf-ink-2);
}
body.cf-theme .cf-footer strong { color: var(--cf-teal-strong); }
@media (max-width: 768px) { body.cf-theme .cf-footer { display: none; } }

/* =============================================================================
   Listes « tableau » (ordonnances, factures, laboratoire), gros boutons d'action,
   pastilles de statut, boutons d'options colorés, agenda Mois / Semaine / Jour
   ============================================================================= */
body.cf-theme .cf-bigbtns { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; }
body.cf-theme .cf-bigbtns:empty { display: none; }
body.cf-theme .cf-bigbtn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 240px; min-height: 46px; padding: 10px 22px;
    border: 0; border-radius: 4px; color: #fff; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.12);
}
body.cf-theme .cf-bigbtn:hover { filter: brightness(.94); }
body.cf-theme .cf-bigbtn:focus-visible { outline: 3px solid #0f7f78; outline-offset: 2px; }
body.cf-theme .cf-bigbtn-cyan { background: #0e7490; }
body.cf-theme .cf-bigbtn-red { background: #b91c1c; }
body.cf-theme .cf-bigbtn-green { background: #15803d; }
body.cf-theme .cf-bigbtn-gray { background: #4a5d62; }

body.cf-theme .cf-box { background: #fff; border: 1px solid var(--cf-line); border-top: 3px solid #0f7f78; border-radius: 6px; box-shadow: 0 1px 2px rgba(22,38,43,.04); }
body.cf-theme .cf-box-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px; padding: 14px 18px 12px; border-bottom: 1px solid var(--cf-line-soft); }
body.cf-theme .cf-box-head h2 { margin: 0; font-size: 19px; font-weight: 600; }
body.cf-theme .cf-box-head p { margin: 0; color: var(--cf-ink-2); font-size: 13.5px; flex-basis: 100%; }
body.cf-theme .cf-box-body { padding: 14px 18px 18px; }
body.cf-theme .cf-box .rx-empty { border: 0; }

body.cf-theme .cf-grid-table { width: 100%; border-collapse: collapse; font-size: 14px; }
body.cf-theme .cf-grid-table th { text-align: left; font-weight: 700; padding: 10px 12px; border-bottom: 2px solid var(--cf-line); white-space: nowrap; background: #f7f9f8; }
body.cf-theme .cf-grid-table td { padding: 10px 12px; border-bottom: 1px solid var(--cf-line-soft); vertical-align: top; }
body.cf-theme .cf-grid-table tbody tr:nth-child(even) td { background: #fafcfb; }
body.cf-theme .cf-grid-table tbody tr:hover td { background: #f1f6f5; }
body.cf-theme .cf-olist { margin: 0; padding-left: 18px; }
body.cf-theme .cf-olist li { margin: 0; }
body.cf-theme .cf-olist li.more { list-style: none; margin-left: -18px; color: var(--cf-ink-3); font-size: 12.5px; }

body.cf-theme .cf-st { display: inline-block; border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 700; white-space: nowrap; line-height: 1.6; }
body.cf-theme .cf-st-amber { background: #fdf1dc; color: #7a4708; }
body.cf-theme .cf-st-green { background: #e5f3ea; color: #145a32; }
body.cf-theme .cf-st-red { background: #fdecea; color: #8a1c13; }
body.cf-theme .cf-st-blue { background: #e6eef6; color: #1d4a7a; }
body.cf-theme .cf-st-teal { background: #e4efed; color: #14524f; }
body.cf-theme .cf-st-gray { background: #eef1f0; color: #4a5d62; }

body.cf-theme .cf-opts { display: flex; flex-wrap: wrap; gap: 0; }
body.cf-theme .cf-opt {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid transparent; font: inherit; font-size: 12.5px; font-weight: 600;
    color: #fff; cursor: pointer; text-decoration: none; white-space: nowrap; line-height: 1.4;
}
body.cf-theme .cf-opts .cf-opt:first-child { border-radius: 4px 0 0 4px; }
body.cf-theme .cf-opts .cf-opt:last-child { border-radius: 0 4px 4px 0; }
body.cf-theme .cf-opts .cf-opt:only-child { border-radius: 4px; }
body.cf-theme .cf-opt:hover { filter: brightness(.92); color: #fff; }
body.cf-theme .cf-opt:focus-visible { outline: 2px solid #0f7f78; outline-offset: 1px; position: relative; z-index: 1; }
body.cf-theme .cf-opt-view { background: #f4f6f5; color: var(--cf-ink); border-color: var(--cf-line); }
body.cf-theme .cf-opt-view:hover { color: var(--cf-ink); }
body.cf-theme .cf-opt-pdf { background: #1d5fa8; }
body.cf-theme .cf-opt-edit { background: #0e7490; }
body.cf-theme .cf-opt-ok { background: #15803d; }
body.cf-theme .cf-opt-warn { background: #b45309; }
body.cf-theme .cf-opt-del { background: #b91c1c; }
@media (max-width: 900px) { body.cf-theme .cf-opts { gap: 4px; } body.cf-theme .cf-opts .cf-opt { border-radius: 4px !important; } }

/* Tableau : recherche, lignes par page, tri, pages */
body.cf-theme .cf-dt-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; font-size: 14px; color: var(--cf-ink-2); }
body.cf-theme .cf-dt-top select, body.cf-theme .cf-dt-top input { border: 1px solid var(--cf-line); border-radius: 4px; padding: 6px 8px; font: inherit; color: var(--cf-ink); background: #fff; }
body.cf-theme .cf-dt-top input { width: 220px; max-width: 60vw; }
body.cf-theme .cf-dt-top select:focus, body.cf-theme .cf-dt-top input:focus { outline: 2px solid #0f7f78; outline-offset: -1px; }
body.cf-theme .cf-dt-scroll { overflow-x: auto; }
body.cf-theme .cf-dt-sortable { cursor: pointer; user-select: none; position: relative; padding-right: 22px !important; }
body.cf-theme .cf-dt-sortable::after { content: '\21C5'; position: absolute; right: 7px; color: #b7c4c1; font-weight: 400; }
body.cf-theme .cf-dt-sortable[aria-sort="ascending"]::after { content: '\2191'; color: #0f7f78; }
body.cf-theme .cf-dt-sortable[aria-sort="descending"]::after { content: '\2193'; color: #0f7f78; }
body.cf-theme .cf-dt-sortable:focus-visible { outline: 2px solid #0f7f78; outline-offset: -2px; }
body.cf-theme .cf-dt-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 13.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-dt-pages { display: flex; }
body.cf-theme .cf-dt-pages button, body.cf-theme .cf-dt-pages span { min-width: 38px; padding: 6px 10px; border: 1px solid var(--cf-line); margin-left: -1px; background: #fff; font: inherit; color: var(--cf-teal-strong); cursor: pointer; text-align: center; }
body.cf-theme .cf-dt-pages button:first-child { border-radius: 4px 0 0 4px; }
body.cf-theme .cf-dt-pages button:last-child { border-radius: 0 4px 4px 0; }
body.cf-theme .cf-dt-pages button[aria-current="page"] { background: #0f7f78; color: #fff; border-color: #0f7f78; }
body.cf-theme .cf-dt-pages button:disabled { color: #b7c4c1; cursor: default; }
body.cf-theme .cf-dt-pages span { color: var(--cf-ink-3); cursor: default; }
body.cf-theme .cf-dt-pages button:focus-visible { outline: 2px solid #0f7f78; outline-offset: -2px; position: relative; }

/* Fenêtres (laboratoire, accès patient) */
body.cf-theme .cf-dlg { border: 0; border-radius: 10px; padding: 0; width: min(640px, calc(100% - 20px)); box-shadow: 0 30px 80px rgba(22,38,43,.35); color: var(--cf-ink); border-top: 3px solid #0f7f78; }
body.cf-theme .cf-dlg::backdrop { background: rgba(22,38,43,.45); }
body.cf-theme .cf-dlg .in { padding: 20px 22px; max-height: 86vh; overflow: auto; }
body.cf-theme .cf-dlg h3 { margin: 0 0 8px; font-size: 19px; }
body.cf-theme .cf-dlg label { display: block; font-weight: 600; font-size: 14px; margin: 12px 0 6px; }
body.cf-theme .cf-dlg .foot { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 18px; }
body.cf-theme .cf-dlg .rx-note { background: #e3efed; color: #14524f; border-radius: 8px; padding: 10px 12px; font-size: 13.5px; margin: 10px 0; }
body.cf-theme .cf-check { display: flex !important; align-items: center; gap: 8px; font-weight: 600; }
body.cf-theme .cf-check input { width: 18px; height: 18px; }
body.cf-theme .cf-dlg-err { color: #b91c1c; font-size: 14px; margin: 8px 0 0; min-height: 1px; }
body.cf-theme .cf-cred { display: grid; gap: 8px; margin: 12px 0; padding: 12px 14px; background: #f7f9f8; border: 1px solid var(--cf-line); border-radius: 8px; }
body.cf-theme .cf-cred div { display: flex; flex-wrap: wrap; gap: 4px 14px; }
body.cf-theme .cf-cred dt { min-width: 170px; color: var(--cf-ink-2); }
body.cf-theme .cf-cred dd { margin: 0; font-weight: 700; word-break: break-all; }
body.cf-theme .cf-lab-res { background: #f7f9f8; border: 1px solid #e6ecea; border-radius: 8px; padding: 10px 12px; }
body.cf-theme .action-btn.cf-access-btn { color: #0e7490; }
body.cf-theme .cf-seg { display: inline-flex; border: 1px solid var(--cf-line); border-radius: 6px; overflow: hidden; }
body.cf-theme .cf-seg button { border: 0; border-left: 1px solid var(--cf-line); background: #fff; padding: 6px 12px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--cf-ink-2); }
body.cf-theme .cf-seg button:first-child { border-left: 0; }
body.cf-theme .cf-seg button[aria-pressed="true"] { background: #0f7f78; color: #fff; }
body.cf-theme .cf-seg button:focus-visible { outline: 2px solid #0f7f78; outline-offset: -2px; }
body.cf-theme .cf-tile-more-off { min-height: 8px; padding: 0; }
body.cf-theme .cf-lab .cf-figures { margin-bottom: 16px; }

/* Agenda */
body.cf-theme .cf-cal-legend { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
body.cf-theme .cf-legend-chip { display: inline-block; min-width: 150px; padding: 7px 12px; border-radius: 3px; color: #fff; font-weight: 600; font-size: 14px; }
body.cf-theme .cf-legend-amber { background: #b45309; } body.cf-theme .cf-legend-teal { background: #0f766e; }
body.cf-theme .cf-legend-blue { background: #1d5fa8; } body.cf-theme .cf-legend-red { background: #b91c1c; }
body.cf-theme .cf-cal-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 0 12px; border-top: 3px solid #0f7f78; }
body.cf-theme .cf-cal-nav, body.cf-theme .cf-cal-views { display: flex; gap: 0; }
body.cf-theme .cf-cal-views { justify-self: end; }
body.cf-theme .cf-cal-title { margin: 0; font-size: 24px; font-weight: 500; text-align: center; white-space: nowrap; }
body.cf-theme .cf-cal-btn { border: 1px solid #c9d3d1; background: #f4f6f5; padding: 6px 12px; font: inherit; font-size: 14px; color: var(--cf-ink); cursor: pointer; margin-left: -1px; }
body.cf-theme .cf-cal-nav .cf-cal-btn:first-child, body.cf-theme .cf-cal-views .cf-cal-btn:first-child { border-radius: 4px 0 0 4px; margin-left: 0; }
body.cf-theme .cf-cal-nav .cf-cal-btn:nth-child(2), body.cf-theme .cf-cal-views .cf-cal-btn:last-child { border-radius: 0 4px 4px 0; }
body.cf-theme .cf-cal-nav [data-caltoday] { margin-left: 8px; border-radius: 4px; }
body.cf-theme .cf-cal-btn:hover { background: #e7ecea; }
body.cf-theme .cf-cal-btn[aria-pressed="true"] { background: #d6dfdc; box-shadow: inset 0 2px 4px rgba(0,0,0,.12); font-weight: 600; }
body.cf-theme .cf-cal-btn:focus-visible { outline: 2px solid #0f7f78; outline-offset: -2px; position: relative; z-index: 1; }
body.cf-theme #cfApptFilters.is-list { display: flex; }
body.cf-theme #cfApptFilters:not(.is-list) input[type="date"] { display: none; }

body.cf-theme .cf-cal-month { border: 1px solid var(--cf-line); border-radius: 4px; overflow: hidden; }
body.cf-theme .cf-cal-dow, body.cf-theme .cf-cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
body.cf-theme .cf-cal-dow div { text-align: center; font-weight: 700; font-size: 13.5px; padding: 6px 4px; background: #f7f9f8; border-left: 1px solid var(--cf-line); border-bottom: 1px solid var(--cf-line); }
body.cf-theme .cf-cal-dow div:first-child, body.cf-theme .cf-cal-cell:first-child { border-left: 0; }
body.cf-theme .cf-cal-cell { min-height: 112px; padding: 4px 5px 6px; border-left: 1px solid var(--cf-line); border-bottom: 1px solid var(--cf-line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
body.cf-theme .cf-cal-week:last-child .cf-cal-cell { border-bottom: 0; }
body.cf-theme .cf-cal-cell:hover { background: #f7faf9; }
body.cf-theme .cf-cal-cell.is-out { background: #fafbfb; }
body.cf-theme .cf-cal-cell.is-out .cf-cal-num { color: #b0bcb9; }
body.cf-theme .cf-cal-cell.is-today { background: #fdf8e4; }
body.cf-theme .cf-cal-num { align-self: flex-end; background: none; border: 0; font: inherit; font-size: 15px; color: var(--cf-ink-2); cursor: pointer; padding: 0 3px; border-radius: 4px; }
body.cf-theme .cf-cal-num:hover { background: #e4efed; }
body.cf-theme .cf-cal-cell.is-today .cf-cal-num { color: #fff; background: #0f7f78; font-weight: 700; }
body.cf-theme .cf-ev {
    display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid; border-radius: 3px; padding: 2px 6px; font: inherit; font-size: 12.5px;
    line-height: 1.35; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.cf-theme .cf-ev small { display: block; font-size: 11.5px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.cf-theme .cf-ev:focus-visible { outline: 2px solid #0f7f78; outline-offset: 1px; }
body.cf-theme .cf-ev-amber { background: #fdf1dc; border-color: #b45309; color: #6b3d06; }
body.cf-theme .cf-ev-teal { background: #e0f0ed; border-color: #0f766e; color: #0b4d47; }
body.cf-theme .cf-ev-blue { background: #e6eef6; border-color: #1d5fa8; color: #173f69; }
body.cf-theme .cf-ev-red { background: #fdecea; border-color: #b91c1c; color: #7f1d1d; text-decoration: line-through; }
body.cf-theme .cf-ev-gray { background: #eef1f0; border-color: #74878b; color: #374649; }
body.cf-theme .cf-ev:hover { filter: brightness(.96); }
body.cf-theme .cf-cal-more { background: none; border: 0; font: inherit; font-size: 12px; color: #0f7f78; font-weight: 700; text-align: left; padding: 0 4px; cursor: pointer; }
body.cf-theme .cf-cal-grid { border: 1px solid var(--cf-line); border-radius: 4px; overflow: auto; }
body.cf-theme .cf-cal-ghead, body.cf-theme .cf-cal-grow { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(120px, 1fr)); }
body.cf-theme .cf-cal-ghead > div { padding: 8px; font-weight: 700; font-size: 13.5px; background: #f7f9f8; border-left: 1px solid var(--cf-line); border-bottom: 1px solid var(--cf-line); text-align: center; position: sticky; top: 0; }
body.cf-theme .cf-cal-ghead > div:first-child { border-left: 0; }
body.cf-theme .cf-cal-ghead > div small { display: block; font-weight: 500; color: var(--cf-ink-2); font-size: 12px; }
body.cf-theme .cf-cal-ghead > div.is-today { background: #fdf8e4; color: #0b4d47; }
body.cf-theme .cf-cal-hour { font-size: 12.5px; color: var(--cf-ink-3); text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--cf-line-soft); }
body.cf-theme .cf-cal-slot { min-height: 52px; padding: 3px; border-left: 1px solid var(--cf-line); border-bottom: 1px solid var(--cf-line-soft); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
body.cf-theme .cf-cal-slot:hover { background: #f7faf9; }
body.cf-theme .cf-appt-del { margin-right: auto; }
@media (max-width: 900px) {
    body.cf-theme .cf-cal-bar { grid-template-columns: 1fr auto; }
    body.cf-theme .cf-cal-title { grid-column: 1 / -1; grid-row: 1; font-size: 20px; }
    body.cf-theme .cf-legend-chip { min-width: 0; flex: 1 1 40%; }
    body.cf-theme .cf-cal-cell { min-height: 72px; padding: 2px; }
    body.cf-theme .cf-ev { font-size: 11px; padding: 1px 3px; }
    body.cf-theme .cf-ev b { display: none; }
    body.cf-theme .cf-bigbtn { min-width: 0; flex: 1 1 100%; }
}
/* Fenêtres <dialog> : centrées (la remise à zéro générale des marges les collait en haut à gauche) */
body.cf-theme dialog:modal { margin: auto; }

/* =============================================================================
   Haut du menu : établissement et utilisateur réunis dans un seul bloc
   (l'établissement reste cliquable vers l'accueil, l'utilisateur est une ligne d'information)
   ============================================================================= */
body.cf-theme .sidebar-header { background: var(--cf-frame-2); padding: 14px 14px 6px; border-bottom: 0; }
body.cf-theme .cf-establishment { padding: 6px; gap: 12px; }
body.cf-theme .cf-establishment:hover { background: rgba(255,255,255,.06); }
body.cf-theme .cf-est-mark { flex-basis: 40px; width: 40px; height: 40px; border-radius: 10px; font-size: 15px; }
body.cf-theme .cf-user-panel {
    background: var(--cf-frame-2); margin: 0; padding: 8px 20px 14px; gap: 10px;
    border-bottom: 1px solid var(--cf-frame-line); position: relative;
}
body.cf-theme .cf-user-panel::before { content: ''; position: absolute; left: 20px; right: 20px; top: 0; border-top: 1px solid var(--cf-frame-line); }
body.cf-theme .cf-user-panel-photo {
    flex: 0 0 28px; width: 28px; height: 28px; margin-left: 6px; font-size: 12px;
    background: rgba(255,255,255,.14); color: #fff; box-shadow: none;
}
body.cf-theme .cf-user-panel-text { padding-left: 6px; }
body.cf-theme .cf-user-panel-text strong { font-size: 13px; font-weight: 600; color: #e6f2ef; }
body.cf-theme .cf-user-panel-text span { font-size: 11.5px; }
body.cf-theme .cf-user-panel { padding-top: 10px; }

/* =============================================================================
   Avatars, messagerie, appels, services et gardes, bloc « garde et surveillance »
   ============================================================================= */
body.cf-theme .cf-av { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%; background: #d9ebe8; color: #0b4d47; font-weight: 700; font-size: 13px; overflow: hidden; }
body.cf-theme .cf-av img { width: 100%; height: 100%; object-fit: cover; }
body.cf-theme .cf-av-sm { width: 30px; height: 30px; font-size: 12px; }
body.cf-theme .cf-av-md { width: 42px; height: 42px; font-size: 15px; }
body.cf-theme .cf-av-xl { width: 96px; height: 96px; font-size: 34px; }
body.cf-theme .cf-av-icon { background: #0f766e; color: #fff; font-size: 16px; }
body.cf-theme .cf-av-spacer { flex: 0 0 30px; }
body.cf-theme .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body.cf-theme .cf-st-violet { background: #efe8fb; color: #4c2a8c; }
body.cf-theme .cf-st-light { background: transparent; border: 1px solid var(--cf-line); font-weight: 600; }
body.cf-theme .cf-st small { font-weight: 600; opacity: .85; }
body.cf-theme .cf-tile-gray { background: #4a5d62; }
body.cf-theme .cf-linkbtn { background: none; border: 0; color: #0f7f78; cursor: pointer; padding: 2px 6px; border-radius: 4px; font: inherit; font-size: 13px; font-weight: 600; }
body.cf-theme .cf-linkbtn:hover { background: #e4efed; }
body.cf-theme .cf-hint { display: block; color: var(--cf-ink-3); font-size: 12.5px; margin-top: 4px; }

/* Bouton messagerie de l'en-tête et compteur du menu */
body.cf-theme .cf-msg-wrap { position: relative; }
body.cf-theme .cf-nav-count { margin-left: auto; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 7px; line-height: 1.5; }

/* Notifications discrètes */
.cf-msg-toasts { position: fixed; right: 16px; bottom: 16px; z-index: 10050; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); }
.cf-msg-toast { display: flex; gap: 12px; align-items: flex-start; text-align: left; background: #fff; color: #16262b; border: 0; border-left: 4px solid #0f7f78; border-radius: 8px; padding: 12px 14px; box-shadow: 0 10px 30px rgba(22,38,43,.22); font: inherit; cursor: pointer; animation: cfToastIn .25s ease-out; }
.cf-msg-toast i { color: #0f7f78; font-size: 18px; margin-top: 2px; }
.cf-msg-toast strong { display: block; font-size: 14px; }
.cf-msg-toast span span { display: block; font-size: 13.5px; color: #4a5d62; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cf-msg-toast.out { opacity: 0; transform: translateX(20px); transition: all .35s; }
@keyframes cfToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* Appel entrant */
.cf-call-incoming { position: fixed; inset: 0; z-index: 10100; background: rgba(12,48,46,.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.cf-call-card { background: #fff; color: #16262b; border-radius: 16px; padding: 30px 28px 26px; width: min(380px, 100%); text-align: center; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.cf-call-card h2 { margin: 6px 0 2px; font-size: 24px; }
.cf-call-kind { margin: 16px 0 0; color: #0f7f78; font-weight: 700; }
.cf-call-sub { margin: 0; color: #4a5d62; }
.cf-call-actions { display: flex; justify-content: center; gap: 22px; margin-top: 24px; }
.cf-call-round { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; font: inherit; font-size: 13px; font-weight: 600; color: #16262b; cursor: pointer; }
.cf-call-round i { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff; }
.cf-call-accept i { background: #15803d; } .cf-call-decline i { background: #b91c1c; }
.cf-call-round:focus-visible i { outline: 3px solid #0f7f78; outline-offset: 3px; }
.cf-ring { animation: cfRing 1.4s ease-out infinite; }
@keyframes cfRing { 0% { box-shadow: 0 0 0 0 rgba(15,127,120,.5); } 100% { box-shadow: 0 0 0 22px rgba(15,127,120,0); } }

/* Appel en cours */
.cf-call-panel { position: fixed; right: 16px; bottom: 16px; z-index: 10060; width: min(360px, calc(100vw - 32px)); background: #0c302e; color: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.cf-call-panel.is-video { width: min(520px, calc(100vw - 32px)); }
.cf-call-stage { position: relative; min-height: 210px; display: flex; align-items: center; justify-content: center; background: #123f3c; }
.cf-call-remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: none; background: #000; }
.cf-call-panel.has-video .cf-call-remote { display: block; }
.cf-call-panel.has-video.peer-cam-off .cf-call-remote { display: none; }
.cf-call-panel.has-video:not(.peer-cam-off) .cf-call-who { display: none; }
.cf-call-panel.is-video .cf-call-stage { aspect-ratio: 16 / 10; }
.cf-call-who { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 20px; text-align: center; }
.cf-call-who strong { font-size: 18px; }
.cf-call-state { font-size: 13.5px; color: #b9d3cd; min-height: 1.2em; }
.cf-call-local { position: absolute; right: 10px; bottom: 10px; width: 28%; max-width: 140px; border-radius: 8px; border: 2px solid rgba(255,255,255,.6); display: none; background: #000; }
.cf-call-panel.is-video .cf-call-local { display: block; }
.cf-call-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.cf-call-timer { margin-right: auto; font-variant-numeric: tabular-nums; font-weight: 700; color: #cfe6e0; }
.cf-call-ctl { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 17px; cursor: pointer; }
.cf-call-ctl[aria-pressed="false"] { background: #fff; color: #b91c1c; }
.cf-call-ctl:hover { background: rgba(255,255,255,.24); }
.cf-call-ctl:focus-visible { outline: 3px solid #5eead4; outline-offset: 2px; }
.cf-call-hang { background: #b91c1c; } .cf-call-hang:hover { background: #991b1b; }
.cf-call-panel.is-min .cf-call-stage { display: none; }
.cf-call-panel.is-ending { opacity: .85; }

/* Messagerie */
body.cf-theme .cf-chat { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 210px); min-height: 480px; background: #fff; border: 1px solid var(--cf-line); border-top: 3px solid #0f7f78; border-radius: 6px; overflow: hidden; }
body.cf-theme .cf-chat-side { display: flex; flex-direction: column; border-right: 1px solid var(--cf-line); min-height: 0; background: #fbfcfc; }
body.cf-theme .cf-chat-side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
body.cf-theme .cf-chat-side-head h2 { margin: 0; font-size: 18px; }
body.cf-theme .cf-chat-search { margin: 0 14px 8px; padding: 8px 12px; border: 1px solid var(--cf-line); border-radius: 8px; font: inherit; }
body.cf-theme .cf-chat-search:focus { outline: 2px solid #0f7f78; outline-offset: -1px; }
body.cf-theme .cf-chat-perm { margin: 0 14px 8px; background: #fff7e6; border: 1px solid #f1d08f; color: #7a4b00; border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; text-align: left; }
body.cf-theme .cf-chat-list { list-style: none; margin: 0; padding: 0 6px 10px; overflow-y: auto; flex: 1; }
body.cf-theme .cf-chat-empty { padding: 20px 12px; color: var(--cf-ink-3); text-align: center; list-style: none; }
body.cf-theme .cf-chat-item { display: flex; gap: 10px; width: 100%; padding: 10px 8px; border: 0; background: none; border-radius: 8px; text-align: left; font: inherit; cursor: pointer; align-items: center; }
body.cf-theme .cf-chat-item:hover { background: #eef4f3; }
body.cf-theme .cf-chat-item.is-active { background: #dceeea; }
body.cf-theme .cf-chat-item:focus-visible { outline: 2px solid #0f7f78; outline-offset: -2px; }
body.cf-theme .cf-chat-item-txt { flex: 1; min-width: 0; }
body.cf-theme .cf-chat-item-top, body.cf-theme .cf-chat-item-bot { display: flex; align-items: center; gap: 8px; }
body.cf-theme .cf-chat-item-top strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14.5px; }
body.cf-theme .cf-chat-item-top time { font-size: 12px; color: var(--cf-ink-3); }
body.cf-theme .cf-chat-snip { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; color: var(--cf-ink-2); }
body.cf-theme .cf-chat-item.is-unread .cf-chat-snip, body.cf-theme .cf-chat-item.is-unread strong { color: var(--cf-ink); font-weight: 700; }
body.cf-theme .cf-chat-count { background: #0f7f78; color: #fff; border-radius: 999px; font-size: 11.5px; font-weight: 700; padding: 1px 7px; }
body.cf-theme .cf-chat-st { font-size: 11px; font-weight: 700; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
body.cf-theme .cf-chat-main { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
body.cf-theme .cf-chat-blank { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--cf-ink-3); gap: 10px; padding: 20px; text-align: center; }
body.cf-theme .cf-chat-blank i { font-size: 40px; color: #b7d3ce; }
body.cf-theme .cf-chat-blank.sm { padding: 40px 0; }
body.cf-theme .cf-chat-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--cf-line); }
body.cf-theme .cf-chat-head-txt { flex: 1; min-width: 0; }
body.cf-theme .cf-chat-head h2 { margin: 0; font-size: 17px; }
body.cf-theme .cf-chat-head p { margin: 0; font-size: 13px; color: var(--cf-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.cf-theme .cf-chat-head-act { display: flex; gap: 6px; }
body.cf-theme .cf-chat-ibtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--cf-line); background: #fff; color: #0f7f78; cursor: pointer; font-size: 15px; text-decoration: none; }
body.cf-theme .cf-chat-ibtn:hover { background: #e4efed; }
body.cf-theme .cf-chat-ibtn:focus-visible { outline: 2px solid #0f7f78; outline-offset: 1px; }
body.cf-theme .cf-chat-back { display: none; background: none; border: 0; font-size: 18px; color: var(--cf-ink); cursor: pointer; padding: 6px; }
body.cf-theme .cf-chat-scroll { flex: 1; overflow-y: auto; padding: 16px 18px 8px; background: #f6f8f8; }
body.cf-theme .cf-chat-day { text-align: center; margin: 14px 0 8px; }
body.cf-theme .cf-chat-day span { background: #e6ecea; color: var(--cf-ink-2); font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
body.cf-theme .cf-chat-sys { text-align: center; color: var(--cf-ink-2); font-size: 13px; margin: 8px 0; }
body.cf-theme .cf-chat-call { color: #145a32; } body.cf-theme .cf-chat-call.is-missed { color: #b91c1c; }
body.cf-theme .cf-chat-msg { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; max-width: 78%; }
body.cf-theme .cf-chat-msg.is-grouped { margin-top: 3px; }
body.cf-theme .cf-chat-msg.is-mine { margin-left: auto; flex-direction: row-reverse; }
body.cf-theme .cf-chat-msg.is-mine .cf-av-spacer { display: none; }
body.cf-theme .cf-chat-bubble { background: #fff; border: 1px solid #e3e9e7; border-radius: 14px 14px 14px 4px; padding: 8px 12px 6px; font-size: 14.5px; line-height: 1.45; min-width: 60px; overflow-wrap: anywhere; }
body.cf-theme .cf-chat-msg.is-mine .cf-chat-bubble { background: #0f766e; color: #fff; border-color: #0f766e; border-radius: 14px 14px 4px 14px; }
body.cf-theme .cf-chat-msg.is-mine .cf-chat-bubble a { color: #fff; }
body.cf-theme .cf-chat-from { display: block; font-size: 12px; font-weight: 700; color: #0f7f78; margin-bottom: 2px; }
body.cf-theme .cf-chat-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: 11px; opacity: .7; margin-top: 2px; }
body.cf-theme .cf-chat-delbtn { background: none; border: 0; color: inherit; cursor: pointer; font-size: 11px; padding: 0 2px; opacity: .8; }
body.cf-theme .cf-chat-del { opacity: .7; }
body.cf-theme .cf-chat-img img { display: block; max-width: 260px; max-height: 240px; border-radius: 8px; margin: 2px 0 4px; }
body.cf-theme .cf-chat-file { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.05); text-decoration: none; color: inherit; margin: 2px 0 4px; }
body.cf-theme .cf-chat-file i { font-size: 20px; color: #b91c1c; }
body.cf-theme .cf-chat-msg.is-mine .cf-chat-file { background: rgba(255,255,255,.15); } body.cf-theme .cf-chat-msg.is-mine .cf-chat-file i { color: #fff; }
body.cf-theme .cf-chat-file small { opacity: .75; }
body.cf-theme .cf-chat-read { text-align: right; font-size: 12px; color: var(--cf-ink-3); margin: 4px 4px 0; }
body.cf-theme .cf-chat-read i { color: #0f7f78; }
body.cf-theme .cf-chat-more { display: block; margin: 0 auto 10px; background: #fff; border: 1px solid var(--cf-line); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 13px; cursor: pointer; color: #0f7f78; }
body.cf-theme .cf-chat-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--cf-line); }
body.cf-theme .cf-chat-compose textarea { flex: 1; resize: none; border: 1px solid var(--cf-line); border-radius: 20px; padding: 10px 14px; font: inherit; font-size: 15px; max-height: 160px; line-height: 1.4; }
body.cf-theme .cf-chat-compose textarea:focus { outline: 2px solid #0f7f78; outline-offset: -1px; }
body.cf-theme .cf-chat-attach, body.cf-theme .cf-chat-send { width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 42px; cursor: pointer; font-size: 17px; }
body.cf-theme .cf-chat-attach { color: var(--cf-ink-2); background: #f1f5f4; }
body.cf-theme .cf-chat-attach:focus-within { outline: 2px solid #0f7f78; }
body.cf-theme .cf-chat-send { background: #0f766e; color: #fff; border: 0; }
body.cf-theme .cf-chat-send:hover { background: #0b5e58; }
body.cf-theme .cf-chat-note { margin: 0; padding: 0 14px 8px; font-size: 11.5px; color: var(--cf-ink-3); }
body.cf-theme .cf-pick { list-style: none; margin: 8px 0; padding: 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--cf-line); border-radius: 8px; }
body.cf-theme .cf-pick li[data-pid] { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-top: 1px solid var(--cf-line-soft); cursor: pointer; }
body.cf-theme .cf-pick li:first-child { border-top: 0; }
body.cf-theme .cf-pick li[data-pid] > span:nth-child(2) { flex: 1; min-width: 0; }
body.cf-theme .cf-pick li strong { display: block; font-size: 14px; }
body.cf-theme .cf-pick li small { display: block; color: var(--cf-ink-2); font-size: 12.5px; }
body.cf-theme .cf-pick li:hover { background: #f1f6f5; }
body.cf-theme .cf-pick li[aria-selected="true"] { background: #dceeea; }
body.cf-theme .cf-pick-ok { color: #0f7f78; visibility: hidden; }
body.cf-theme .cf-pick li[aria-selected="true"] .cf-pick-ok { visibility: visible; }
body.cf-theme .cf-pick li:focus-visible { outline: 2px solid #0f7f78; outline-offset: -2px; }
@media (max-width: 900px) {
    body.cf-theme .cf-chat { grid-template-columns: 1fr; height: calc(100vh - 150px); }
    body.cf-theme .cf-chat .cf-chat-main { display: none; }
    body.cf-theme .cf-chat.has-conv .cf-chat-side { display: none; }
    body.cf-theme .cf-chat.has-conv .cf-chat-main { display: flex; }
    body.cf-theme .cf-chat-back { display: inline-block; }
    body.cf-theme .cf-chat-msg { max-width: 90%; }
}

/* Services */
body.cf-theme .cf-dept-tabs { padding: 0 14px; border-bottom: 1px solid var(--cf-line); }
body.cf-theme .cf-dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
body.cf-theme .cf-dept-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--cf-line); border-left: 5px solid var(--dc); border-radius: 8px; padding: 16px; }
body.cf-theme .cf-dept-card header { display: flex; gap: 12px; align-items: center; }
body.cf-theme .cf-dept-card h3 { margin: 0; font-size: 17px; }
body.cf-theme .cf-dept-card header p { margin: 0; color: var(--cf-ink-2); font-size: 13px; }
body.cf-theme .cf-dept-ic { width: 44px; height: 44px; border-radius: 10px; background: var(--dc, #0f766e); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex: 0 0 44px; }
body.cf-theme .cf-dept-desc { margin: 0; color: var(--cf-ink-2); font-size: 13.5px; }
body.cf-theme .cf-dept-meta { display: grid; gap: 4px; margin: 0; font-size: 13.5px; }
body.cf-theme .cf-dept-meta div { display: flex; gap: 8px; }
body.cf-theme .cf-dept-meta dt { color: var(--cf-ink-3); min-width: 110px; }
body.cf-theme .cf-dept-meta dd { margin: 0; font-weight: 600; }
body.cf-theme .cf-dept-now { display: flex; flex-wrap: wrap; gap: 6px; }
body.cf-theme .cf-dept-faces { display: flex; }
body.cf-theme .cf-dept-faces > span { margin-right: -6px; border: 2px solid #fff; border-radius: 50%; }
body.cf-theme .cf-dept-more { width: 30px; height: 30px; border-radius: 50%; background: #eef1f0; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
body.cf-theme .cf-dept-card footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; border-top: 1px solid var(--cf-line-soft); }
body.cf-theme .cf-dept-tag { display: inline-block; border-left: 3px solid var(--dc); background: #f4f6f5; padding: 1px 8px; border-radius: 3px; font-size: 12.5px; margin: 1px 0; }
body.cf-theme .cf-team { list-style: none; margin: 12px 0 0; padding: 0; }
body.cf-theme .cf-team li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--cf-line-soft); flex-wrap: wrap; }
body.cf-theme .cf-team-txt { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
body.cf-theme .cf-team-txt > span { color: var(--cf-ink-2); font-size: 13px; }
body.cf-theme .cf-dlg.cf-dlg-wide { width: min(860px, calc(100% - 20px)); }
body.cf-theme .cf-form-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
body.cf-theme .cf-icons { display: flex; flex-wrap: wrap; gap: 4px; }
body.cf-theme .cf-icons button { width: 34px; height: 34px; border: 1px solid var(--cf-line); background: #fff; border-radius: 6px; cursor: pointer; color: var(--cf-ink-2); }
body.cf-theme .cf-icons button[aria-checked="true"] { background: #0f766e; color: #fff; border-color: #0f766e; }
body.cf-theme .cf-members { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; border: 1px solid var(--cf-line); border-radius: 8px; }
body.cf-theme .cf-members li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 10px; border-top: 1px solid var(--cf-line-soft); }
body.cf-theme .cf-members li:first-child { border-top: 0; }
body.cf-theme .cf-members .cf-check { margin: 0 !important; flex: 1; min-width: 220px; font-weight: 500; }
body.cf-theme .cf-members .cf-check small { color: var(--cf-ink-3); }
body.cf-theme .cf-members input.form-control { flex: 1; min-width: 200px; padding: 5px 8px; }
body.cf-theme .cf-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
body.cf-theme .cf-quick .cf-cal-btn { border-radius: 4px; margin: 0; }
body.cf-theme .cf-plan-bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; }
body.cf-theme .cf-plan-tools { display: flex; gap: 8px; align-items: center; }
body.cf-theme .cf-plan-tools select { min-width: 200px; }
body.cf-theme .cf-plan-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--cf-ink-2); margin-bottom: 10px; }
body.cf-theme .cf-plan-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
body.cf-theme .cf-plan-wrap { overflow-x: auto; border: 1px solid var(--cf-line); border-radius: 6px; }
body.cf-theme .cf-plan { width: 100%; border-collapse: collapse; min-width: 900px; font-size: 13px; }
body.cf-theme .cf-plan th, body.cf-theme .cf-plan td { border-bottom: 1px solid var(--cf-line-soft); border-left: 1px solid var(--cf-line-soft); padding: 6px; vertical-align: top; }
body.cf-theme .cf-plan thead th { background: #f7f9f8; font-weight: 700; text-align: center; position: sticky; top: 0; }
body.cf-theme .cf-plan tbody th { text-align: left; font-weight: 400; background: #fbfcfc; min-width: 200px; position: sticky; left: 0; z-index: 1; }
body.cf-theme .cf-plan .is-today { background: #fdf8e4; }
body.cf-theme .cf-plan td { min-width: 104px; height: 52px; cursor: cell; }
body.cf-theme .cf-plan td:hover { background: #f4f8f7; }
body.cf-theme .cf-plan-who { display: flex; align-items: center; gap: 8px; }
body.cf-theme .cf-plan-who strong { display: block; font-size: 13.5px; }
body.cf-theme .cf-plan-who small { display: block; color: var(--cf-ink-3); font-size: 12px; }
body.cf-theme .cf-shift { display: block; width: 100%; text-align: left; border: 0; border-left: 4px solid var(--sc); background: color-mix(in srgb, var(--sc) 14%, #fff); color: #16262b; border-radius: 4px; padding: 3px 6px; margin-bottom: 3px; font: inherit; font-size: 12px; cursor: pointer; line-height: 1.3; }
body.cf-theme .cf-shift b { display: block; font-size: 12px; }
body.cf-theme .cf-shift:focus-visible { outline: 2px solid #0f7f78; }
body.cf-theme .cf-duo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
body.cf-theme .cf-h3 { margin: 0 0 10px; font-size: 16px; display: flex; gap: 8px; align-items: center; }
body.cf-theme .cf-h3 i { color: #0f7f78; }
body.cf-theme .cf-contacts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
body.cf-theme .cf-contacts li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--cf-line); border-radius: 8px; background: #fff; }
body.cf-theme .cf-contacts li > span { flex: 1; min-width: 0; }
body.cf-theme .cf-contacts b { display: block; font-size: 14px; }
body.cf-theme .cf-contacts small { color: var(--cf-ink-3); font-size: 12px; }
body.cf-theme .cf-contact-call { min-width: 74px; text-align: center; background: #b91c1c; color: #fff; text-decoration: none; border-radius: 6px; padding: 6px 10px; font-size: 15px; font-variant-numeric: tabular-nums; }
body.cf-theme .cf-contact-call:hover { background: #991b1b; color: #fff; }
body.cf-theme .cf-contacts-sm li { padding: 6px 8px; }
body.cf-theme .cf-contacts-sm .cf-contact-call { min-width: 60px; font-size: 14px; padding: 4px 8px; }
body.cf-theme .cf-ann { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
body.cf-theme .cf-ann li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--cf-line); border-radius: 8px; background: #fff; }
body.cf-theme .cf-ann li > div { flex: 1; min-width: 0; }
body.cf-theme .cf-ann li.cf-ann-urgent { border-color: #f3c7c2; background: #fff7f6; }
body.cf-theme .cf-ann strong { display: block; }
body.cf-theme .cf-ann p { margin: 2px 0; font-size: 13.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-ann small { color: var(--cf-ink-3); font-size: 12px; }

/* Tableau de bord : garde et surveillance */
body.cf-theme .cf-duty { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0 0 22px; }
body.cf-theme .cf-duty > .cf-skeleton { grid-column: 1 / -1; }
body.cf-theme .cf-duty-card { background: #fff; border: 1px solid var(--cf-line); border-radius: 8px; padding: 14px 16px; min-width: 0; }
body.cf-theme .cf-duty-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
body.cf-theme .cf-duty-card header h3 { margin: 0; font-size: 15.5px; flex: 1; }
body.cf-theme .cf-duty-list { list-style: none; margin: 0; padding: 0; }
body.cf-theme .cf-duty-list > li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--cf-line-soft); }
body.cf-theme .cf-duty-list > li:first-child { border-top: 0; padding-top: 0; }
body.cf-theme .cf-duty-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
body.cf-theme .cf-duty-txt strong { font-size: 14px; }
body.cf-theme .cf-duty-txt > span { font-size: 12.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-duty-txt .cf-st { font-size: 11px; }
body.cf-theme .cf-duty-act { display: flex; gap: 4px; }
body.cf-theme .cf-duty-act .cf-chat-ibtn { width: 32px; height: 32px; font-size: 13px; }
body.cf-theme .cf-duty-empty { color: var(--cf-ink-2); font-size: 13.5px; margin: 0; }
body.cf-theme .cf-duty-next, body.cf-theme .cf-duty-sum { font-size: 12.5px; color: var(--cf-ink-2); margin: 8px 0 0; }
body.cf-theme .cf-room-no { min-width: 48px; text-align: center; background: #f1f5f4; border-radius: 6px; padding: 4px 6px; font-weight: 800; font-size: 15px; line-height: 1.2; }
body.cf-theme .cf-room-no small { display: block; font-weight: 600; font-size: 11px; color: var(--cf-ink-3); }
body.cf-theme .cf-duty-rooms .cf-st { margin-right: 2px; }
@media (max-width: 1300px) { body.cf-theme .cf-duty { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    body.cf-theme .cf-duty, body.cf-theme .cf-duo { grid-template-columns: 1fr; }
    body.cf-theme .cf-plan-bar { grid-template-columns: 1fr; }
    body.cf-theme .cf-plan-tools { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .cf-ring, .cf-msg-toast { animation: none; } }
.cf-call-round:focus { outline: none; }
body.cf-theme .cf-dept-meta a { color: #0f7f78; text-decoration: none; }
body.cf-theme .cf-dept-meta a:hover { text-decoration: underline; }
@media (max-width: 1600px) { body.cf-theme .cf-duty { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { body.cf-theme .cf-duty { grid-template-columns: 1fr; } }
body.cf-theme .cf-duty-card .cf-duty-list, body.cf-theme .cf-duty-card .cf-ann, body.cf-theme .cf-duty-card .cf-contacts { max-height: 340px; overflow-y: auto; }

/* =============================================================================
   Harmonisation (maj 42) : panneaux « .card » en encadré, Rapports, Finances,
   Référentiel clinique, Confidentialité
   ============================================================================= */
body.cf-theme #contentArea .card { border-top: 3px solid #0f7f78; border-radius: 6px; }
body.cf-theme #contentArea .card .card { border-top-width: 1px; }
body.cf-theme #contentArea .card-header h3 > i:first-child, body.cf-theme #contentArea .card-header h2 > i:first-child { color: #0f7f78; margin-right: 4px; }
body.cf-theme .cf-figures[data-count="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1300px) { body.cf-theme .cf-figures[data-count="5"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { body.cf-theme .cf-figures[data-count="5"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
body.cf-theme .cf-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Rapports */
body.cf-theme .cf-rep-tabs button i { margin-right: 4px; opacity: .8; }
body.cf-theme .cf-rep .cf-box-body { padding: 18px; }
body.cf-theme .cf-rep-tiles { margin-bottom: 18px; }
body.cf-theme .cf-rep-tiles .cf-tile-body strong { font-size: 26px; }
body.cf-theme .cf-rep-sec { border: 1px solid var(--cf-line); border-radius: 6px; padding: 14px 16px; margin-bottom: 16px; min-width: 0; background: #fff; }
body.cf-theme .cf-rep-sec h3 { margin: 0 0 12px; font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
body.cf-theme .cf-rep-sec h3 i { color: #0f7f78; width: 18px; text-align: center; }
body.cf-theme .cf-rep-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
body.cf-theme .cf-rep-minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
body.cf-theme .cf-rep-mini { background: #f7f9f8; border-left: 3px solid #0f7f78; border-radius: 4px; padding: 10px 12px; }
body.cf-theme .cf-rep-mini strong { display: block; font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cf-ink); }
body.cf-theme .cf-rep-mini span { display: block; font-size: 12.5px; color: var(--cf-ink-2); margin-top: 2px; }
body.cf-theme .cf-rep-scroll { overflow-x: auto; }
body.cf-theme .cf-rep-table td { vertical-align: middle; }
body.cf-theme .cf-rep-barcell { min-width: 160px; white-space: nowrap; }
body.cf-theme .cf-rep-bar { display: inline-block; vertical-align: middle; width: calc(100% - 64px); max-width: 260px; height: 10px; background: #e8eeec; border-radius: 5px; overflow: hidden; }
body.cf-theme .cf-rep-bar-fill { display: block; height: 100%; border-radius: 5px; }
body.cf-theme .cf-rep-pct { display: inline-block; min-width: 56px; text-align: right; font-size: 12.5px; color: var(--cf-ink-2); font-variant-numeric: tabular-nums; }
body.cf-theme .cf-rep-gauge { display: flex; align-items: center; gap: 14px; }
body.cf-theme .cf-rep-gauge .cf-rep-bar { flex: 1; max-width: none; width: auto; height: 18px; border-radius: 9px; }
body.cf-theme .cf-rep-gauge strong { font-size: 24px; font-weight: 800; min-width: 84px; text-align: right; }
body.cf-theme .cf-rep-note { margin: 8px 0 0; font-size: 12.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-rep-empty { margin: 0; padding: 18px 4px; color: var(--cf-ink-2); }
body.cf-theme .cf-rep-bg-teal { background: #0f766e; } body.cf-theme .cf-rep-bg-blue { background: #1d5fa8; }
body.cf-theme .cf-rep-bg-green { background: #15803d; } body.cf-theme .cf-rep-bg-amber { background: #b45309; }
body.cf-theme .cf-rep-bg-red { background: #b91c1c; } body.cf-theme .cf-rep-bg-violet { background: #6d3fc0; }
body.cf-theme .cf-rep-bg-gray { background: #6b7c80; }
body.cf-theme .cf-rep-green { color: #15803d !important; } body.cf-theme .cf-rep-red { color: #b91c1c !important; }
body.cf-theme .cf-rep-amber { color: #b45309 !important; } body.cf-theme .cf-rep-violet { color: #6d3fc0 !important; }
@media (max-width: 1000px) { body.cf-theme .cf-rep-cols { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
    body.cf-theme .cf-rep .cf-box-body { padding: 12px; }
    body.cf-theme .cf-rep-tiles .cf-tile-body strong { font-size: 20px; }
    body.cf-theme .cf-rep-sec { padding: 12px; }
    body.cf-theme .cf-rep-barcell { min-width: 120px; }
}
body.cf-theme .cf-grid-table th.cf-num { text-align: right; }
body.cf-theme .cf-rep-tabs { margin: 0; padding: 0 12px; }

/* Finances */
body.cf-theme .finance-header { margin: 0 0 18px; padding: 0 12px; background: #fff; border: 1px solid var(--cf-line); border-top: 3px solid #0f7f78; border-radius: 6px; }
body.cf-theme .finance-tabs { padding: 0; gap: 2px; }
body.cf-theme .finance-tab, body.cf-theme .finance-tab.active { border-radius: 0 !important; background: transparent !important; color: var(--cf-ink-2) !important; padding: 13px 14px 11px; border-bottom: 3px solid transparent; font-size: 14px; }
body.cf-theme .finance-tab:hover { color: var(--cf-ink) !important; }
body.cf-theme .finance-tab.active { color: #0f7f78 !important; border-bottom-color: #0f7f78; }
body.cf-theme .finance-tab:focus-visible { outline: 2px solid #0f7f78; outline-offset: -2px; }
body.cf-theme .finance-toolbar { margin-bottom: 14px; }
body.cf-theme .toolbar-filters select, body.cf-theme .toolbar-filters input { border-color: var(--cf-line); border-radius: 4px; min-height: 38px; }
body.cf-theme .cf-fin-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 18px; }
body.cf-theme .cf-fin-grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.cf-theme .cf-fin-grid > .card { margin-bottom: 18px; min-width: 0; }
body.cf-theme .cf-fin-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
body.cf-theme .cf-fin-actions .cf-bigbtn { min-width: 0; width: 100%; font-size: 14px; }
body.cf-theme .cf-fin-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
body.cf-theme .cf-fin-sum-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body.cf-theme .cf-fin-sum .finance-stat-card { border-left: 3px solid #0f7f78; padding: 12px 14px; }
body.cf-theme .cf-fin-sum .stat-value { font-size: 20px; }
body.cf-theme .cf-bars-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--cf-ink-2); margin-bottom: 10px; }
body.cf-theme .cf-bars-legend span { display: inline-flex; align-items: center; gap: 6px; }
body.cf-theme .cf-bars-max { margin-left: auto; }
body.cf-theme .cf-dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
body.cf-theme .cf-bars { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; height: 220px; align-items: end; border-bottom: 1px solid var(--cf-line); padding-top: 4px;
    background-image: linear-gradient(to top, var(--cf-line-soft) 1px, transparent 1px); background-size: 100% 25%; }
body.cf-theme .cf-bars-col { display: flex; flex-direction: column; height: 100%; min-width: 0; }
body.cf-theme .cf-bars-pair { flex: 1; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
body.cf-theme .cf-bars-bar { display: block; width: 42%; max-width: 18px; min-height: 0; border-radius: 3px 3px 0 0; }
body.cf-theme .cf-bars-lbl { text-align: center; font-size: 11.5px; color: var(--cf-ink-2); padding-top: 6px; transform: translateY(100%); margin-top: -18px; white-space: nowrap; overflow: hidden; }
body.cf-theme .cf-bars { margin-bottom: 26px; }
body.cf-theme .doc-card { border-color: var(--cf-line) !important; border-radius: 6px !important; }
body.cf-theme .doc-card:hover { border-color: #0f7f78 !important; box-shadow: 0 2px 8px rgba(15,127,120,.12) !important; }
body.cf-theme .doc-icon.image { background: #e4efed !important; color: #0f7f78 !important; }
body.cf-theme .doc-actions.cf-opts { justify-content: center; }
body.cf-theme .upload-zone { border-color: #b9cbc7; border-radius: 6px; background: #fff; }
body.cf-theme .upload-zone:hover, body.cf-theme .upload-zone.dragover { border-color: #0f7f78; background: #f1f6f5; }
body.cf-theme .upload-zone:hover i { color: #0f7f78; }
@media (max-width: 1100px) {
    body.cf-theme .cf-fin-grid, body.cf-theme .cf-fin-grid-even { grid-template-columns: 1fr; }
    body.cf-theme .cf-fin-sum, body.cf-theme .cf-fin-sum-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    body.cf-theme .cf-fin-actions { grid-template-columns: 1fr; }
    body.cf-theme .cf-bars { height: 160px; gap: 3px; }
    body.cf-theme .cf-bars-lbl { font-size: 10px; }
    body.cf-theme .cf-bars-max { margin-left: 0; flex-basis: 100%; }
}

/* Référentiel clinique */
body.cf-theme .cf-cds .cf-figures { margin-bottom: 16px; }
body.cf-theme .cf-cds .cf-tile-body strong { font-size: 22px; }
body.cf-theme .cf-cds .cds-notice { border-radius: 6px; border-left: 4px solid #0f7f78; }
body.cf-theme .cf-cds-box { margin-bottom: 18px; }
body.cf-theme .cf-cds-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
body.cf-theme .category-filter { padding: 7px 14px; border: 1px solid var(--cf-line); background: #fff; color: var(--cf-ink-2); border-radius: 999px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
body.cf-theme .category-filter:hover { border-color: #0f7f78; color: var(--cf-ink); }
body.cf-theme .category-filter.active { background: #0f7f78; border-color: #0f7f78; color: #fff; }
body.cf-theme .category-filter:focus-visible { outline: 2px solid #0f7f78; outline-offset: 2px; }
body.cf-theme .cf-cds-lang { margin: 0 0 12px; padding: 8px 12px; border-radius: 6px; background: #fdf1dc; color: #7a4708; font-size: 13.5px; }
body.cf-theme .cds-specialties { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; max-height: 330px; overflow-y: auto; padding: 2px; }
body.cf-theme .cds-specialties .specialty-btn { border-width: 1px !important; border-left-width: 4px !important; justify-content: flex-start !important; border-radius: 4px !important; min-height: 40px !important; box-shadow: none !important; padding: 8px 10px !important; }
body.cf-theme .cds-specialties .specialty-btn span, body.cf-theme .cds-specialties .specialty-btn { font-size: 13px !important; }
body.cf-theme .cds-specialties .specialty-btn:focus-visible { outline: 2px solid #0f7f78; outline-offset: 1px; }
body.cf-theme .cf-cds-tabs { margin: 0; padding: 0 12px; border-top: 0; border-bottom: 1px solid var(--cf-line); }
body.cf-theme .cf-cds-tabs .cds-tab { background: transparent !important; box-shadow: none !important; border-radius: 0 !important; transform: none !important; padding: 13px 14px 11px; border-bottom: 3px solid transparent; color: var(--cf-ink-2); font-family: inherit; font-size: 14px; }
body.cf-theme .cf-cds-tabs .cds-tab:hover { color: var(--cf-ink); }
body.cf-theme .cf-cds-tabs .cds-tab.active { color: #0f7f78 !important; border-bottom-color: #0f7f78; }
body.cf-theme .cf-cds .urgence-banner { background: #b45309; box-shadow: none; border-radius: 6px; }
body.cf-theme .cf-cds .disease-card { border-radius: 6px; box-shadow: none; border: 1px solid var(--cf-line); border-left: 4px solid #0f7f78; }
body.cf-theme .cf-cds .disease-card:hover { transform: none; box-shadow: 0 2px 8px rgba(22,38,43,.08); }
body.cf-theme .cf-cds .disease-card.urgent { border-left-color: #b45309; background: #fffaf2; }
body.cf-theme .cf-cds .symptom-tag { background: #e4efed; color: #14524f; }
body.cf-theme .cf-cds .calculator-card { background: #fff; border-radius: 6px; border-left: 4px solid #b45309; }
body.cf-theme .cf-cds .calculator-card:hover { transform: none; }
body.cf-theme .cf-cds .score-result { background: #0f766e; box-shadow: none; border-radius: 6px; }
body.cf-theme .cf-cds .info-box { background: #e6eef6; border-left-color: #1d5fa8; color: #1d4a7a; border-radius: 0 6px 6px 0; }
body.cf-theme .cf-cds .warning-box, body.cf-theme .cf-cds .danger-box { border-radius: 0 6px 6px 0; }
@media (max-width: 760px) {
    body.cf-theme .cds-specialties { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    body.cf-theme .cf-cds .cf-tile-body strong { font-size: 18px; }
}
body.cf-theme #contentArea .cf-box .card { border-top: 1px solid var(--cf-line); }
body.cf-theme .cf-cds .card-header[style] { background: transparent !important; color: var(--cf-ink) !important; padding: 0 0 12px !important; }
body.cf-theme .cf-cds .card-header[style] h3 { color: var(--cf-ink) !important; }
body.cf-theme .cf-cds .card-header h3 i { color: #0f7f78 !important; }
body.cf-theme .cds-specialties { overflow-y: auto; align-content: start; }

/* Confidentialité */
body.cf-theme .cf-priv .cf-figures { margin-bottom: 18px; }
body.cf-theme .cf-priv .cf-tile-body strong { font-size: 26px; }
body.cf-theme .cf-priv .cf-tile-body span { padding-right: 70px; }
body.cf-theme .cf-priv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
body.cf-theme .cf-priv-sec { border: 1px solid var(--cf-line); border-radius: 6px; padding: 14px 16px; min-width: 0; }
body.cf-theme .cf-priv-sec header { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
body.cf-theme .cf-priv-sec h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
body.cf-theme .cf-priv-sec p, body.cf-theme .cf-priv-contact p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--cf-ink-2); }
body.cf-theme .cf-priv a { color: #0f7f78; font-weight: 600; }
body.cf-theme .cf-priv-contact { margin-top: 18px; }
body.cf-theme .cf-priv-contact .cf-box-body { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding: 16px 18px; }
body.cf-theme .cf-priv-contact .cf-box-body > div { flex: 1 1 420px; }
body.cf-theme .cf-priv-contact h3 { margin: 0 0 6px; font-size: 16px; }
body.cf-theme .cf-priv-contact h3 i { color: #0f7f78; margin-right: 6px; }
@media (max-width: 1100px) { body.cf-theme .cf-figures[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { body.cf-theme .cf-priv-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) { body.cf-theme .cf-priv .cf-figures[data-count="3"] { grid-template-columns: 1fr; } body.cf-theme .cf-priv .cf-tile-body strong { font-size: 21px; } }
body.cf-theme .cf-figures[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 700px) { body.cf-theme .cf-figures[data-count="3"] { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    body.cf-theme .main-header .cf-title-stack { overflow: hidden; flex: 1 1 auto; }
    body.cf-theme .main-header .page-title { max-width: 100%; }
}
/* Barres d'onglets dans un encadré : pas de marge négative (le soulignement dépassait du cadre) */
body.cf-theme .cf-box > .pv-tabs, body.cf-theme .cf-dept-tabs { margin: 0; padding: 0 12px; border-top: 0; }

/* Licence : bandeau, module non inclus, Paramètres > Licence */
body.cf-theme .cf-lic-banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 9px 28px; font-size: 14px; border-bottom: 1px solid var(--cf-line); }
body.cf-theme .cf-lic-banner[hidden] { display: none; }
body.cf-theme .cf-lic-banner > span { flex: 1 1 320px; }
body.cf-theme .cf-lic-teal { background: #e4efed; color: #14524f; }
body.cf-theme .cf-lic-amber { background: #fdf1dc; color: #7a4708; }
body.cf-theme .cf-lic-red { background: #fdecea; color: #8a1c13; }
body.cf-theme .cf-lic-btn { border: 1px solid currentColor; background: transparent; color: inherit; border-radius: 4px; padding: 5px 12px; font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; }
body.cf-theme .cf-lic-btn:hover { background: rgba(255,255,255,.5); }
body.cf-theme .cf-lic-x { border: 0; background: none; color: inherit; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; }
body.cf-theme .cf-lic-x:hover { background: rgba(0,0,0,.06); }
body.cf-theme .cf-lic-off .cf-box-body { text-align: center; padding: 40px 20px; }
body.cf-theme .cf-lic-off .cf-box-body > i { font-size: 40px; color: #0f7f78; margin-bottom: 12px; }
body.cf-theme .cf-lic-off h2 { margin: 0 0 8px; font-size: 20px; }
body.cf-theme .cf-lic-off p { margin: 0 auto 18px; max-width: 560px; color: var(--cf-ink-2); }
body.cf-theme .cf-lic-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; font-size: 18px; }
body.cf-theme .cf-lic-title > i { color: #0f7f78; }
body.cf-theme .cf-lic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 14px; }
body.cf-theme .cf-lic-kv { border: 1px solid var(--cf-line); border-left: 3px solid #0f7f78; border-radius: 4px; padding: 9px 12px; min-width: 0; }
body.cf-theme .cf-lic-kv span { display: block; font-size: 12.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-lic-kv strong { display: block; font-size: 15px; margin-top: 2px; overflow-wrap: anywhere; }
body.cf-theme .cf-lic-kv code { font-size: 15px; letter-spacing: .03em; }
body.cf-theme .cf-lic-copy { margin-left: 6px; border: 1px solid var(--cf-line); background: #fff; border-radius: 4px; padding: 2px 8px; font: inherit; font-size: 12px; cursor: pointer; }
body.cf-theme .cf-lic-note { margin: 0 0 12px; color: var(--cf-ink-2); font-size: 13.5px; }
body.cf-theme .cf-lic-alert { margin: 0 0 12px; padding: 10px 12px; border-radius: 4px; background: #fdecea; color: #8a1c13; font-size: 14px; }
body.cf-theme .cf-lic-import { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 6px 0 18px; }
body.cf-theme .cf-lic-import .cf-bigbtn { min-width: 0; }
body.cf-theme .cf-lic-msg { flex-basis: 100%; margin: 0; font-size: 14px; min-height: 1em; }
body.cf-theme .cf-lic-msg.is-err { color: #b91c1c; } body.cf-theme .cf-lic-msg.is-ok { color: #15803d; }
body.cf-theme .cf-lic-sub { margin: 4px 0 8px; font-size: 16px; }
body.cf-theme .cf-lic-mods { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 8px; }
body.cf-theme .cf-lic-mods li { display: flex; align-items: center; gap: 10px; border: 1px solid var(--cf-line); border-radius: 6px; padding: 9px 12px; }
body.cf-theme .cf-lic-mods li > div { flex: 1; min-width: 0; }
body.cf-theme .cf-lic-mods strong { display: block; font-size: 14px; }
body.cf-theme .cf-lic-mods small { display: block; font-size: 12.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-lic-mods li.is-off { background: #fafbfb; }
body.cf-theme .cf-lic-mods li.is-off strong { color: var(--cf-ink-2); }
body.cf-theme .pv-gray { background: #eef1f0; color: #6b7c80; }
@media (max-width: 768px) { body.cf-theme .cf-lic-banner { padding: 8px 14px; font-size: 13px; } body.cf-theme .cf-lic-mods { grid-template-columns: 1fr; } }
body.cf-theme .cf-lic-over { display: block; font-size: 12px; font-weight: 600; color: #b91c1c; }

/* =============================================================================
   Page d'accueil (vitrine) : bandeau avec ligne de pouls, prochain rendez-vous,
   frise de la journée, espaces, « À faire », dernières activités
   ============================================================================= */
body.cf-theme .cf-home2 { display: flex; flex-direction: column; gap: 18px; }
body.cf-theme .cf-hero {
    position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: 24px; align-items: stretch;
    padding: 28px 30px 30px; border-radius: 10px; color: #fff;
    background: radial-gradient(120% 140% at 85% 0%, #17a196 0%, rgba(23,161,150,0) 55%), linear-gradient(135deg, #0c3b38 0%, #0f5f5a 55%, #0f7f78 100%);
    box-shadow: 0 6px 24px rgba(12, 59, 56, .22);
}
body.cf-theme .cf-hero-ecg { position: absolute; left: 0; right: 0; bottom: 6px; width: 100%; height: 110px; pointer-events: none; }
body.cf-theme .cf-hero-ecg path { fill: none; stroke: #8fe3d6; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; opacity: .38;
    stroke-dasharray: 2600; stroke-dashoffset: 2600; animation: cfEcg 2.4s ease-out .2s forwards; vector-effect: non-scaling-stroke; }
@keyframes cfEcg { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { body.cf-theme .cf-hero-ecg path { animation: none; stroke-dashoffset: 0; } }
body.cf-theme .cf-hero-main { position: relative; z-index: 1; min-width: 0; display: flex; flex-direction: column; }
body.cf-theme .cf-hero-id { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
body.cf-theme .cf-hero-photo { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; border: 2px solid rgba(255,255,255,.75); padding: 0; overflow: hidden; cursor: pointer;
    background: #fff; color: #0f5f5a; font: inherit; font-size: 22px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
body.cf-theme .cf-hero-photo img { width: 100%; height: 100%; object-fit: cover; }
body.cf-theme .cf-hero-photo:focus-visible { outline: 3px solid #f5c97a; outline-offset: 2px; }
body.cf-theme .cf-hero-meta { margin: 0; color: #c8ece7; font-size: 14px; font-weight: 500; }
body.cf-theme .cf-hero h2 { margin: 0 0 8px; font-size: clamp(28px, 3.4vw, 42px); line-height: 1.08; letter-spacing: -0.02em; font-weight: 800; color: #fff; }
body.cf-theme .cf-hero-lead { margin: 0 0 22px; font-size: 16.5px; color: #e3f5f2; max-width: 60ch; }
body.cf-theme .cf-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; }
body.cf-theme .cf-hero-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 16px; border-radius: 6px; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
    background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.32); transition: background .15s ease; }
body.cf-theme .cf-hero-btn:hover { background: rgba(255,255,255,.22); }
body.cf-theme .cf-hero-btn.is-main { background: #fff; color: #0f5f5a; border-color: #fff; }
body.cf-theme .cf-hero-btn.is-main:hover { background: #e4f4f1; }
body.cf-theme .cf-hero-btn:focus-visible { outline: 3px solid #f5c97a; outline-offset: 2px; }
body.cf-theme .cf-hero-next { position: relative; z-index: 1; align-self: stretch; display: flex; flex-direction: column; gap: 4px; padding: 18px 20px;
    border-radius: 8px; background: rgba(255,255,255,.96); color: var(--cf-ink); box-shadow: 0 8px 24px rgba(0,0,0,.18); border-left: 5px solid #f5a524; }
body.cf-theme .cf-hero-next-k { margin: 0; font-size: 13px; font-weight: 700; color: #b45309; }
body.cf-theme .cf-hero-next-t { margin: 2px 0 0; font-size: 44px; line-height: 1; font-weight: 800; letter-spacing: -0.02em; color: #0f5f5a; font-variant-numeric: tabular-nums; }
body.cf-theme .cf-hero-next-p { margin: 6px 0 0; font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
body.cf-theme .cf-hero-next-s { margin: 0 0 10px; font-size: 13.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-hero-next .cf-hero-btn { align-self: flex-start; margin-top: auto; background: #0f7f78; color: #fff; border-color: #0f7f78; }
body.cf-theme .cf-hero-next .cf-hero-btn:not(.is-main) { background: #fff; color: #0f5f5a; border-color: var(--cf-line); }
body.cf-theme .cf-hero-next .cf-hero-btn:hover { filter: brightness(.95); }
body.cf-theme .cf-hero-next-after { margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--cf-line-soft); font-size: 13px; color: var(--cf-ink-2); }
body.cf-theme .cf-hero-next-empty { margin: 10px 0 14px; font-size: 16px; color: var(--cf-ink-2); }
body.cf-theme .cf-hero-next-empty i { color: #b45309; margin-right: 6px; }

/* Frise de la journée */
body.cf-theme .cf-dayline-box .cf-box-head { flex-wrap: wrap; }
body.cf-theme .cf-dayline-box .cf-box-head h2 { flex: 0 0 auto; }
body.cf-theme .cf-dayline-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--cf-ink-2); margin-right: auto; margin-left: 12px; }
body.cf-theme .cf-dayline-legend span { display: inline-flex; align-items: center; gap: 6px; }
body.cf-theme .cf-dayline-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
body.cf-theme .cf-dl { position: relative; padding: 0 18px 0 0; }
body.cf-theme .cf-dl-track { position: relative; height: var(--dl-h); margin-right: 132px; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 12 - 1px), transparent calc(100% / 12 - 1px) calc(100% / 12)); border-bottom: 2px solid var(--cf-line); }
body.cf-theme .cf-dl-hours { position: relative; height: 22px; margin-right: 132px; }
body.cf-theme .cf-dl-hours span { position: absolute; top: 4px; transform: translateX(-50%); font-size: 11.5px; color: var(--cf-ink-3); font-variant-numeric: tabular-nums; }
body.cf-theme .cf-dl-hours span::before { content: ''; position: absolute; left: 50%; top: -8px; width: 1px; height: 6px; background: var(--cf-line); }
body.cf-theme .cf-dl-chip { position: absolute; width: 128px; height: 32px; display: flex; align-items: center; gap: 4px; padding: 0 8px; border: 0; border-left: 4px solid; border-radius: 4px; cursor: pointer;
    font: inherit; font-size: 12.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
body.cf-theme .cf-dl-chip span { overflow: hidden; text-overflow: ellipsis; }
body.cf-theme .cf-dl-chip:hover { filter: brightness(.96); box-shadow: 0 2px 6px rgba(0,0,0,.14); z-index: 2; }
body.cf-theme .cf-dl-chip:focus-visible { outline: 2px solid #0f7f78; outline-offset: 1px; z-index: 3; }
body.cf-theme .cf-dl-teal { background: #e4efed; border-color: #0f766e; color: #14524f; }
body.cf-theme .cf-dl-amber { background: #fdf1dc; border-color: #b45309; color: #7a4708; }
body.cf-theme .cf-dl-gray { background: #eef1f0; border-color: #8a9a9d; color: #4a5d62; }
body.cf-theme .cf-dl-violet { background: #efe8fb; border-color: #6d3fc0; color: #4c2a8c; }
body.cf-theme .cf-dl-chip.is-past { opacity: .6; }
body.cf-theme .cf-dl-now { position: absolute; top: -6px; bottom: -2px; width: 2px; background: #dc2626; z-index: 4; pointer-events: none; }
body.cf-theme .cf-dl-now::before { content: ''; position: absolute; top: -4px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; }
body.cf-theme .cf-dl-now em { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 700; color: #dc2626; background: #fff; padding: 0 3px; }
body.cf-theme .cf-dl-more { margin: 4px 0 0; }
body.cf-theme .cf-dl-list { display: none; list-style: none; margin: 0; padding: 0; }
body.cf-theme .cf-dl-list li { display: flex; gap: 12px; align-items: center; padding: 9px 10px; border-left: 4px solid; border-radius: 4px; margin-bottom: 6px; cursor: pointer; }
body.cf-theme .cf-dl-list b { font-variant-numeric: tabular-nums; min-width: 44px; }
body.cf-theme .cf-dl-list strong { display: block; font-size: 14px; }
body.cf-theme .cf-dl-list small { display: block; font-size: 12.5px; opacity: .85; }

/* Espaces et « À faire » */
body.cf-theme .cf-home-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
body.cf-theme .cf-launch { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
body.cf-theme .cf-launch-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--cf-line); border-radius: 8px; background: #fff;
    font: inherit; text-align: left; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; min-width: 0; }
body.cf-theme .cf-launch-item:hover { border-color: #0f7f78; box-shadow: 0 4px 12px rgba(15,127,120,.12); transform: translateY(-1px); }
body.cf-theme .cf-launch-item:focus-visible { outline: 3px solid #0f7f78; outline-offset: 2px; }
body.cf-theme .cf-launch-ic { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; }
body.cf-theme .cf-launch-tx { min-width: 0; }
body.cf-theme .cf-launch-tx strong { display: block; font-size: 14.5px; color: var(--cf-ink); }
body.cf-theme .cf-launch-tx small { display: block; font-size: 12.5px; color: var(--cf-ink-2); line-height: 1.35; }
body.cf-theme .cf-todo { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
body.cf-theme .cf-todo-item { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--cf-line); border-radius: 8px; background: #fff; font: inherit; text-align: left; cursor: pointer; }
body.cf-theme .cf-todo-item:hover { border-color: #0f7f78; background: #f7fbfa; }
body.cf-theme .cf-todo-item:focus-visible { outline: 3px solid #0f7f78; outline-offset: 2px; }
body.cf-theme .cf-todo-item > i { color: var(--cf-ink-3); font-size: 12px; }
body.cf-theme .cf-todo-n { min-width: 42px; height: 42px; padding: 0 6px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
body.cf-theme .cf-todo-tx { flex: 1; min-width: 0; }
body.cf-theme .cf-todo-tx strong { display: block; font-size: 14.5px; }
body.cf-theme .cf-todo-tx small { display: block; font-size: 12.5px; color: var(--cf-ink-2); }
body.cf-theme .cf-todo-none { padding: 18px 6px; color: var(--cf-ink-2); }
body.cf-theme .cf-todo-none i { color: #15803d; margin-right: 6px; }
body.cf-theme .cf-todo-wait { padding: 12px; color: var(--cf-ink-3); }

/* Dernières activités */
body.cf-theme .cf-home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 18px; }
body.cf-theme .cf-hcard .cf-box-head { flex-wrap: nowrap; }
body.cf-theme .cf-hcard .cf-box-head h2 { flex: 1; font-size: 16.5px; }
body.cf-theme .cf-hcard .cf-box-body { padding-top: 6px; }
body.cf-theme .cf-hcard .pv-list li:first-child { border-top: 0; }

/* Visite guidée (démonstration) */
body.cf-theme .cf-tour summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; }
body.cf-theme .cf-tour summary::-webkit-details-marker { display: none; }
body.cf-theme .cf-tour summary > span:nth-child(2) { flex: 1; }
body.cf-theme .cf-tour summary strong { display: block; font-size: 16px; }
body.cf-theme .cf-tour summary small { display: block; color: var(--cf-ink-2); font-size: 13px; }
body.cf-theme .cf-tour-chev { color: var(--cf-ink-3); transition: transform .2s ease; }
body.cf-theme .cf-tour[open] .cf-tour-chev { transform: rotate(180deg); }
body.cf-theme .cf-tour .cf-w-steps { border: 0; border-top: 1px solid var(--cf-line-soft); border-radius: 0; }

@media (max-width: 1100px) {
    body.cf-theme .cf-hero { grid-template-columns: 1fr; }
    body.cf-theme .cf-home-cols { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
    body.cf-theme .cf-hero { padding: 20px 16px 22px; border-radius: 8px; }
    body.cf-theme .cf-hero h2 { font-size: 28px; }
    body.cf-theme .cf-hero-lead { font-size: 15px; margin-bottom: 16px; }
    body.cf-theme .cf-hero-btn { min-height: 40px; padding: 0 12px; font-size: 14px; }
    body.cf-theme .cf-hero-next-t { font-size: 36px; }
    body.cf-theme .cf-dl { display: none; }
    body.cf-theme .cf-dl-more { display: none; }
    body.cf-theme .cf-dl-list { display: block; }
    body.cf-theme .cf-dayline-legend { display: none; }
    body.cf-theme .cf-launch { grid-template-columns: 1fr 1fr; }
    body.cf-theme .cf-launch-tx small { display: none; }
    body.cf-theme .cf-launch-item { padding: 8px; gap: 8px; }
    body.cf-theme .cf-launch-ic { width: 36px; height: 36px; flex-basis: 36px; font-size: 15px; }
}
body.cf-theme .cf-hero { padding-bottom: 64px; }
body.cf-theme .cf-hero-ecg { bottom: 4px; height: 54px; }
@media (max-width: 700px) { body.cf-theme .cf-hero { padding-bottom: 56px; } body.cf-theme .cf-hero-ecg { height: 44px; } }
@media (max-width: 700px) {
    body.cf-theme .cf-hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
    body.cf-theme .cf-hero-btn { justify-content: center; }
    body.cf-theme .cf-hero-photo { width: 46px; height: 46px; flex-basis: 46px; font-size: 18px; }
    body.cf-theme .cf-hero-meta { font-size: 13px; }
}

/* =============================================================================
   Accueil, version vitrine (maj 44) : chiffres dans le bandeau, espaces en tuiles de couleur
   ============================================================================= */
body.cf-theme .cf-hero { padding: 30px 32px 22px; row-gap: 22px; border-radius: 10px;
    background: radial-gradient(70% 120% at 92% -10%, rgba(52,211,196,.45) 0%, rgba(52,211,196,0) 60%),
                radial-gradient(60% 90% at -10% 110%, rgba(245,165,36,.18) 0%, rgba(245,165,36,0) 60%),
                linear-gradient(135deg, #0a302d 0%, #0d4f4b 45%, #0f7f78 100%); }
body.cf-theme .cf-hero-ecg { top: 38%; bottom: auto; height: 130px; }
body.cf-theme .cf-hero-ecg path { stroke: #9ff0e3; stroke-width: 2.4; opacity: .5; filter: drop-shadow(0 0 6px rgba(159,240,227,.7)); }
body.cf-theme .cf-hero h2 { font-size: clamp(30px, 3.6vw, 46px); }
body.cf-theme .cf-hero-next { border-left: 0; border-top: 4px solid #f5a524; border-radius: 10px; }
body.cf-theme .cf-hero-next-d { margin: 4px 0 0; font-size: 13.5px; font-weight: 700; color: var(--cf-ink-2); }
body.cf-theme .cf-hero-stats { grid-column: 1 / -1; position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
body.cf-theme .cf-hero-stats[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.cf-theme .cf-hero-stats[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body.cf-theme .cf-hstat { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left;
    padding: 12px 14px; border-radius: 8px; border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.09); color: #fff; font: inherit;
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.cf-theme button.cf-hstat { cursor: pointer; transition: background .15s ease, transform .15s ease; }
body.cf-theme button.cf-hstat:hover { background: rgba(255,255,255,.17); transform: translateY(-1px); }
body.cf-theme button.cf-hstat:focus-visible { outline: 3px solid #f5c97a; outline-offset: 2px; }
body.cf-theme .cf-hstat > i { grid-row: 1 / 3; width: 40px; height: 40px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: rgba(255,255,255,.14); color: #bff3ea; }
body.cf-theme .cf-hstat strong { font-size: 26px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
body.cf-theme .cf-hstat span { font-size: 13px; color: #d3efea; line-height: 1.3; }
body.cf-theme .cf-hstat.is-hot > i { background: #f5a524; color: #3d2600; }

/* Mes espaces : tuiles de couleur */
body.cf-theme .cf-launch-box .cf-box-head p { flex-basis: 100%; }
body.cf-theme .cf-apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
body.cf-theme .cf-app { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; gap: 18px; min-height: 124px; padding: 14px 14px 13px;
    border: 0; border-radius: 8px; color: #fff; text-align: left; font: inherit; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);
    transition: transform .15s ease, box-shadow .15s ease; }
body.cf-theme .cf-app:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(12,48,45,.22); }
body.cf-theme .cf-app:focus-visible { outline: 3px solid #0f7f78; outline-offset: 3px; }
body.cf-theme .cf-app-bg { position: absolute; right: -10px; bottom: -14px; font-size: 84px; color: rgba(0,0,0,.14); transition: transform .2s ease; pointer-events: none; }
body.cf-theme .cf-app:hover .cf-app-bg { transform: scale(1.08) rotate(-4deg); }
body.cf-theme .cf-app-ic { position: relative; width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; font-size: 17px; background: rgba(255,255,255,.2); }
body.cf-theme .cf-app-tx { position: relative; }
body.cf-theme .cf-app-tx strong { display: block; font-size: 15.5px; line-height: 1.2; }
body.cf-theme .cf-app-tx small { display: block; font-size: 12.5px; line-height: 1.35; color: rgba(255,255,255,.88); margin-top: 3px; }
body.cf-theme .cf-todo-box { position: sticky; top: 12px; }

/* Menu : jamais de défilement horizontal (barre de défilement Windows) */
body.cf-theme .sidebar, body.cf-theme .sidebar-nav { overflow-x: hidden; }
/* Barre de défilement du menu : toujours visible sur le fond sombre (indique qu'il y a d'autres rubriques plus bas) */
/* Chrome, Edge, Safari : barre dessinée ci-dessous (elle n'est appliquée que si scrollbar-color / scrollbar-width restent « auto ») */
body.cf-theme .sidebar-nav { scrollbar-width: auto; scrollbar-color: auto; }
/* Firefox : propriétés standard */
@supports (-moz-appearance: none) { body.cf-theme .sidebar-nav { scrollbar-color: rgba(255,255,255,.55) rgba(255,255,255,.10); } }
body.cf-theme .sidebar-nav::-webkit-scrollbar { width: 10px; }
body.cf-theme .sidebar-nav::-webkit-scrollbar-track { background: rgba(255,255,255,.08); }
body.cf-theme .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.50); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; min-height: 40px; }
body.cf-theme .sidebar-nav::-webkit-scrollbar-thumb:hover, body.cf-theme .sidebar-nav::-webkit-scrollbar-thumb:active { background: rgba(255,255,255,.75); background-clip: padding-box; }

@media (max-width: 1100px) { body.cf-theme .cf-hero-stats, body.cf-theme .cf-hero-stats[data-count="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); } body.cf-theme .cf-todo-box { position: static; } }
@media (max-width: 700px) {
    body.cf-theme .cf-hero { padding: 20px 16px 16px; }
    body.cf-theme .cf-hstat { padding: 10px; column-gap: 10px; }
    body.cf-theme .cf-hstat > i { width: 34px; height: 34px; font-size: 15px; }
    body.cf-theme .cf-hstat strong { font-size: 21px; }
    body.cf-theme .cf-hstat span { font-size: 12px; }
    body.cf-theme .cf-apps { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    body.cf-theme .cf-app { min-height: 112px; }
    body.cf-theme .cf-app-tx small { display: none; }
}
@media (prefers-reduced-motion: reduce) { body.cf-theme .cf-app, body.cf-theme .cf-app-bg, body.cf-theme button.cf-hstat { transition: none; } }
body.cf-theme .cf-hero-ecg { position: relative; top: auto; bottom: auto; left: auto; right: auto; display: block; width: calc(100% + 32px); height: 64px; margin: -10px 0 14px -32px; }
body.cf-theme .cf-hero-lead { margin-bottom: 8px; }
@media (max-width: 700px) { body.cf-theme .cf-hero-ecg { width: calc(100% + 16px); margin-left: -16px; height: 48px; } }
body.cf-theme .cf-chat-compose .cf-rt { flex: 1; min-width: 0; }

/* Statut « En ligne » : dans le bouton utilisateur de l'en-tête (et non plus en haut du menu latéral) */
body.cf-theme .main-header .user-btn .user-info { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; margin: 0; padding: 0; background: none; line-height: 1.25; text-align: left; }
body.cf-theme .main-header .user-btn .user-role { text-transform: none; font-size: 12px; white-space: nowrap; }
body.cf-theme .main-header .user-btn .cf-online { color: #86efac; font-weight: 600; }
body.cf-theme .cf-presence { position: relative; display: inline-flex; flex: 0 0 auto; }
body.cf-theme .cf-presence-dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #22c55e; border: 2px solid var(--cf-frame, #155e5b); }

/* Messagerie : message modifié, bandeau de modification, emoji */
.cf-chat-edited { font-style: italic; opacity: .85; }
.cf-chat-editbar { display: flex; align-items: center; gap: 8px; margin: 0 12px; padding: 6px 10px; border-radius: 8px 8px 0 0; background: #eef6f5; color: #14524f; font-size: 13px; font-weight: 600; border: 1px solid var(--cf-line); border-bottom: 0; }
.cf-chat-editbar span { font-weight: 400; color: #4a5d62; flex: 1; }
.cf-chat-emo { border: 0; font-size: 19px; }
.cf-chat-compose .cf-rt-emo { bottom: 100%; }
.cf-chat-meta .cf-chat-delbtn { opacity: .85; }

/* Messagerie : réactions */
.cf-chat-reacts { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.cf-chat-react { border: 1px solid rgba(0,0,0,.12); background: #fff; color: #10282a; border-radius: 999px; padding: 1px 8px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.cf-chat-react b { font-size: 12px; }
.cf-chat-react.is-mine { border-color: #0f7f78; background: #e6f4f2; }
.cf-chat-msg.is-mine .cf-chat-react { border-color: rgba(255,255,255,.5); }
.cf-chat-msg.is-mine .cf-chat-react.is-mine { border-color: #fff; box-shadow: 0 0 0 1px #fff inset; }
.cf-chat-reactpick { position: fixed; z-index: 2000; display: flex; gap: 2px; background: #fff; border: 1px solid var(--cf-line); border-radius: 999px; padding: 4px 6px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.cf-chat-reactpick button { border: 0; background: none; font-size: 22px; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; transition: transform .1s; }
.cf-chat-reactpick button:hover, .cf-chat-reactpick button:focus-visible { background: #eef4f3; transform: scale(1.15); outline: none; }
@media (prefers-reduced-motion: reduce) { .cf-chat-reactpick button { transition: none; } }

/* ===== Bandeau défilant : nom de l'établissement dans l'en-tête (5.39) ===== */
body.cf-theme .main-header .cf-mq {
    --mq-dur: 30s;
    position: relative; flex: 1 1 360px; min-width: 0; max-width: 560px; height: 38px; margin: 0 18px;
    display: flex; align-items: center; overflow: hidden; border-radius: 10px;
    background: linear-gradient(180deg, rgba(0,0,0,.26), rgba(0,0,0,.14));
    box-shadow: inset 0 1px 3px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.08), 0 1px 0 rgba(255,255,255,.10);
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%);
            mask-image: linear-gradient(90deg, transparent 0, #000 44px, #000 calc(100% - 44px), transparent 100%);
}
/* fine trame façon afficheur */
body.cf-theme .main-header .cf-mq::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
}
body.cf-theme .cf-mq-track { display: flex; width: max-content; will-change: transform; }
body.cf-theme .cf-mq.is-ready .cf-mq-track { animation: cf-mq-roll var(--mq-dur) linear infinite; }
body.cf-theme .cf-mq:hover .cf-mq-track { animation-play-state: paused; }
body.cf-theme .cf-mq-group { display: flex; align-items: center; flex: 0 0 auto; }
body.cf-theme .cf-mq-item {
    padding: 0 18px; white-space: nowrap; color: #fff;
    font-size: 15px; font-weight: 700; letter-spacing: .06em; font-variant: small-caps;
    text-shadow: 0 0 10px rgba(134,239,211,.45), 0 0 1px rgba(255,255,255,.6);
}
body.cf-theme .cf-mq-sep { width: 34px; height: 14px; flex: 0 0 auto; fill: none; stroke: #86efd3; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; opacity: .85; filter: drop-shadow(0 0 3px rgba(134,239,211,.6)); }
@keyframes cf-mq-roll { from { transform: translate3d(0,0,0); } to { transform: translate3d(-50%,0,0); } }
@media (prefers-reduced-motion: reduce) {
    body.cf-theme .cf-mq.is-ready .cf-mq-track { animation: none; }
    body.cf-theme .main-header .cf-mq { justify-content: center; -webkit-mask-image: none; mask-image: none; }
    body.cf-theme .cf-mq-group + .cf-mq-group, body.cf-theme .cf-mq-group .cf-mq-sep, body.cf-theme .cf-mq-group .cf-mq-item ~ .cf-mq-item { display: none; }
}
@media (max-width: 1180px) {
    body.cf-theme .main-header { flex-wrap: wrap; row-gap: 8px; }
    body.cf-theme .main-header .header-left { flex: 1 1 0; min-width: 0; }
    body.cf-theme .main-header .cf-mq { order: 3; flex: 1 1 100%; max-width: none; margin: 0 0 2px; height: 32px; border-radius: 8px; }
}
@media (max-width: 768px) {
    body.cf-theme .main-header .cf-mq { height: 30px; }
    body.cf-theme .cf-mq-item { font-size: 13.5px; padding: 0 14px; }
}
@media print { body.cf-theme .main-header .cf-mq { display: none; } }

/* ===== En-tête compact : le titre et le menu ne sont jamais recouverts (5.41) ===== */
@media (max-width: 1180px) {
    body.cf-theme .main-header .header-left { min-width: 120px; }
}
@media (max-width: 1100px) {
    body.cf-theme .main-header .user-btn .user-info { display: none; }
}
@media (max-width: 1000px) {
    body.cf-theme .main-header #cfWx { display: none !important; }
}
@media (max-width: 768px) {
    body.cf-theme .main-header .header-left { min-width: 64px; gap: 10px; }
}
@media (max-width: 600px) {
    body.cf-theme .main-header .header-right { gap: 4px; }
    body.cf-theme .cf-clock-sub { display: none; }
    body.cf-theme .cf-clock-btn { padding: 2px 4px; }
    body.cf-theme .main-header .header-right .notification-btn { width: 34px; height: 34px; min-width: 34px; padding: 0; }
    body.cf-theme .main-header .user-btn { padding: 2px; gap: 0; }
    body.cf-theme .main-header .user-btn .user-avatar { width: 30px; height: 30px; font-size: 13px; }
}
@media (max-width: 340px) {
    body.cf-theme .main-header .page-title { display: none; }
    body.cf-theme .main-header .header-left { min-width: 24px; }
}

/* ===== Écrans étroits : un bloc ne dépasse jamais l'écran, les rubans d'onglets défilent (5.42) ===== */
body.cf-theme #contentArea .cf-box,
body.cf-theme #contentArea .pv-tabs,
body.cf-theme #contentArea .cf-dept-tabs { min-width: 0; max-width: 100%; }
body.cf-theme .pv-tabs, body.cf-theme .cf-dept-tabs { -webkit-overflow-scrolling: touch; scrollbar-width: thin; overscroll-behavior-x: contain; }
body.cf-theme .pv-tabs button, body.cf-theme .cf-dept-tabs button { flex: 0 0 auto; white-space: nowrap; }

/* Tablettes et écrans tactiles : cibles de 40 px minimum (doigt, gants), sans toucher à l'affichage souris */
@media (pointer: coarse) {
    body.cf-theme .action-btn { width: 40px; height: 40px; font-size: 15px; }
    body.cf-theme .btn-sm, body.cf-theme .cf-opt, body.cf-theme .pv-link { min-height: 40px; min-width: 40px; }
    body.cf-theme .btn-sm { padding-top: 8px; padding-bottom: 8px; }
    body.cf-theme #contentArea select, body.cf-theme #contentArea input[type=text], body.cf-theme #contentArea input[type=search],
    body.cf-theme #contentArea input[type=date], body.cf-theme #contentArea input[type=time], body.cf-theme #contentArea input[type=number],
    body.cf-theme #contentArea input[type=email], body.cf-theme #contentArea input[type=tel], body.cf-theme #contentArea input[type=password] { min-height: 42px; font-size: 16px; }
    body.cf-theme #contentArea input[type=checkbox], body.cf-theme #contentArea input[type=radio] { width: 20px; height: 20px; }
    body.cf-theme .cf-appt { min-height: 40px; }
    body.cf-theme .cf-cal-num { min-width: 32px; min-height: 32px; }
    body.cf-theme .cf-ev { min-height: 26px; }
    body.cf-theme .cf-rt-tgl { min-width: 40px; min-height: 40px; }
    body.cf-theme td .action-btn + .action-btn { margin-left: 4px; }
}
