/* ============================================
   PHV Naturo - Design System 2026
   Palette naturopathie : vert sauge, terracotta, crème
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

/* --- CSS Variables --- */
:root {
    /* Couleurs principales */
    --sage-50: #f4f7f2;
    --sage-100: #e4ebe0;
    --sage-200: #c9d7c1;
    --sage-300: #a6bc9b;
    --sage-400: #7d9b6f;
    --sage-500: #5a7a4c;
    --sage-600: #4a6741;
    --sage-700: #3b5234;
    --sage-800: #2f4129;
    --sage-900: #1e2b1b;

    /* Terracotta */
    --terra-50: #fdf5f0;
    --terra-100: #fae8dc;
    --terra-200: #f3ccb0;
    --terra-300: #e5a87a;
    --terra-400: #d4885a;
    --terra-500: #c4704b;
    --terra-600: #a85a3a;
    --terra-700: #8a4830;
    --terra-800: #6d3a28;

    /* Crème / Neutre */
    --cream-50: #fefdfb;
    --cream-100: #fcf9f3;
    --cream-200: #f5f0e8;
    --cream-300: #ebe3d5;
    --cream-400: #d9cebc;

    /* Texte */
    --text-primary: #1a1f16;
    --text-secondary: #4a5240;
    --text-muted: #7a8370;
    --text-light: #a3ac98;
    --text-inverse: #ffffff;

    /* Fonctionnel */
    --success: #4a9b5a;
    --warning: #d4a054;
    --danger: #c45b4b;
    --info: #4a7a9b;

    /* Ombres */
    --shadow-sm: 0 1px 3px rgba(30, 43, 27, 0.06);
    --shadow-md: 0 4px 12px rgba(30, 43, 27, 0.08);
    --shadow-lg: 0 8px 30px rgba(30, 43, 27, 0.12);
    --shadow-xl: 0 16px 50px rgba(30, 43, 27, 0.15);

    /* Rayons */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Transitions */
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-width: 260px;
    --header-height: 0px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Garde-fous anti-débordement horizontal (mobile) : une image plus
   large que son conteneur, ou un mot/email/URL non sécable, sont les
   causes les plus fréquentes de dépassement de la largeur d'écran. */
img, svg, video, iframe, canvas {
    max-width: 100%;
}

body, p, h1, h2, h3, h4, td, th, .subtitle, .badge, .form-control {
    overflow-wrap: break-word;
    word-break: break-word;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream-100);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    color: var(--sage-800);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

a {
    color: var(--sage-600);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--sage-700);
}

/* --- Layout App --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, var(--sage-800) 0%, var(--sage-900) 100%);
    color: var(--text-inverse);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-brand {
    padding: 1.8rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--cream-200);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sidebar-brand .brand-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    color: var(--sage-400);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-section {
    padding: 0.5rem 1.5rem 0.3rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--sage-400);
    font-weight: 600;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.5rem;
    color: var(--sage-200);
    font-size: 0.9rem;
    font-weight: 400;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255,255,255,0.06);
    color: var(--cream-100);
}

.nav-link.active {
    background: rgba(255,255,255,0.1);
    color: var(--cream-100);
    border-left-color: var(--terra-400);
    font-weight: 500;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.nav-link.active svg {
    opacity: 1;
}

.sidebar-footer {
    padding: 1.2rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.8rem;
    color: var(--sage-400);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-footer a {
    color: var(--sage-300);
    font-size: 0.8rem;
}

.sidebar-footer a:hover {
    color: var(--terra-300);
}

/* --- Main Content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* --- Barre + overlay mobile (cachées par défaut, activées sous 768px) --- */
.mobile-topbar {
    display: none;
}

.sidebar-overlay {
    display: none;
}

.page-header {
    padding: 2rem 2.5rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.8rem;
}

.page-header .subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-top: 0.2rem;
}

.page-body {
    padding: 0 2.5rem 3rem;
}

/* --- Cards --- */
.card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--cream-300);
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--cream-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1.1rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--cream-200);
    background: var(--cream-50);
}

/* --- Stat Cards (Dashboard) --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #ffffff;
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--cream-300);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.green { background: var(--sage-100); color: var(--sage-600); }
.stat-icon.terra { background: var(--terra-50); color: var(--terra-500); }
.stat-icon.blue { background: #eef4f9; color: var(--info); }
.stat-icon.gold { background: #fdf6e8; color: var(--warning); }

/* Icônes thématiques des fiches Ressources (couleur/fond posés en inline
   par renderRessourceIcon() car dépendants de la fiche). */
.ressource-icon {
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-info h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.3rem;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--sage-600);
    color: white;
}

.btn-primary:hover {
    background: var(--sage-700);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--cream-200);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--cream-300);
}

.btn-terra {
    background: var(--terra-500);
    color: white;
}

.btn-terra:hover {
    background: var(--terra-600);
    color: white;
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--sage-300);
    color: var(--sage-700);
}

.btn-outline:hover {
    background: var(--sage-50);
    border-color: var(--sage-500);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.78rem;
}

.btn-lg {
    padding: 0.85rem 1.8rem;
    font-size: 0.95rem;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* --- Forms --- */
.form-group {
    margin-bottom: 1.3rem;
}

.form-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.4rem;
}

.form-label .required {
    color: var(--terra-500);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    font-style: italic;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--cream-300);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    background: #ffffff;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--sage-400);
    box-shadow: 0 0 0 3px rgba(90, 122, 76, 0.12);
}

.form-control::placeholder {
    color: var(--text-light);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%234a5240' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.form-row-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--cream-200);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    color: var(--sage-700);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--terra-400);
    border-radius: 2px;
}

/* Radio / Checkbox custom */
.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    cursor: pointer;
}

.form-check input[type="radio"],
.form-check input[type="checkbox"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--cream-400);
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
}

.form-check input[type="radio"] {
    border-radius: 50%;
}

.form-check input[type="radio"]:checked,
.form-check input[type="checkbox"]:checked {
    background: var(--sage-500);
    border-color: var(--sage-500);
}

.form-check label {
    font-size: 0.88rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Score slider */
.score-range {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-range input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: var(--cream-300);
    appearance: none;
    outline: none;
}

.score-range input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--sage-500);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.score-range input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.score-value {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--sage-700);
    min-width: 30px;
    text-align: center;
}

/* --- Tables --- */
.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    text-align: left;
    padding: 0.8rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    border-bottom: 2px solid var(--cream-200);
}

.table td {
    padding: 0.9rem 1rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--cream-100);
    vertical-align: middle;
}

.table tr:hover td {
    background: var(--sage-50);
}

.table .actions {
    display: flex;
    gap: 0.5rem;
}

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success { background: #e8f5ea; color: var(--success); }
.badge-warning { background: #fdf6e8; color: var(--warning); }
.badge-danger { background: #fde8e6; color: var(--danger); }
.badge-info { background: #e8f0f5; color: var(--info); }
.badge-sage { background: var(--sage-100); color: var(--sage-700); }
.badge-terra { background: var(--terra-50); color: var(--terra-600); }

/* --- Stepper (Consultation multi-étapes) --- */
.stepper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2.5rem;
    padding: 1.5rem 1rem;
    background: #ffffff;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--cream-300);
}

.step {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    width: 40px;
    height: 2px;
    background: var(--cream-300);
    margin: 0 0.5rem;
}

.step:not(:last-child).completed::after {
    background: var(--sage-400);
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid var(--cream-300);
    color: var(--text-muted);
    background: #ffffff;
    transition: var(--transition);
    flex-shrink: 0;
}

.step.active .step-number {
    background: var(--sage-600);
    border-color: var(--sage-600);
    color: white;
    box-shadow: 0 0 0 4px rgba(90, 122, 76, 0.15);
}

.step.completed .step-number {
    background: var(--sage-400);
    border-color: var(--sage-400);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    display: none;
}

.step.active .step-label {
    display: block;
    color: var(--sage-700);
    font-weight: 600;
}

/* --- Alert / Flash --- */
.alert {
    padding: 1rem 1.3rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-success {
    background: #e8f5ea;
    color: #2a6e3a;
    border: 1px solid #c8e6cc;
}

.alert-error {
    background: #fde8e6;
    color: #a63a2a;
    border: 1px solid #f5c8c4;
}

.alert-warning {
    background: #fdf6e8;
    color: #8a6a2a;
    border: 1px solid #f5e4b8;
}

.alert-info {
    background: #e8f0f5;
    color: #2a5a7a;
    border: 1px solid #c8dce8;
}

/* --- Login Page --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--sage-100) 0%, var(--cream-200) 50%, var(--terra-50) 100%);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 80vw;
    height: 80vw;
    background: radial-gradient(circle, rgba(90, 122, 76, 0.06) 0%, transparent 70%);
    border-radius: 50%;
}

.login-card {
    background: #ffffff;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    position: relative;
}

.login-card .brand {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-card .brand h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--sage-700);
}

.login-card .brand p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

.login-card .leaf-accent {
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--sage-400), var(--terra-400));
    margin: 1rem auto;
    border-radius: 1px;
}

/* --- Consultation synthèse --- */
.synthese-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.organe-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 1.2rem;
    border: 1.5px solid var(--cream-300);
    transition: var(--transition);
}

.organe-card.alert-high {
    border-color: var(--terra-300);
    background: var(--terra-50);
}

.organe-card.alert-medium {
    border-color: var(--warning);
    background: #fefcf5;
}

.organe-card h4 {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.organe-card ul {
    list-style: none;
    padding: 0;
}

.organe-card li {
    font-size: 0.82rem;
    color: var(--text-secondary);
    padding: 0.2rem 0;
    padding-left: 1rem;
    position: relative;
}

.organe-card li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--terra-400);
    font-weight: 700;
}

/* --- PHV Section --- */
.phv-section {
    margin-bottom: 2rem;
}

.phv-section-header {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--sage-200);
}

.phv-section-header .icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sage-100);
    color: var(--sage-600);
}

.phv-section-header h3 {
    font-size: 1.1rem;
}

/* --- Block editor (blocs structurés du PHV : conseils, menu, ressources) --- */
.block-editor-list {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    margin-bottom: 0.7rem;
}

.block-editor-card {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
    padding: 0.8rem;
    background: var(--cream-50);
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-md);
}

.block-editor-card-fields {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.block-editor-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--text-muted);
    margin-bottom: -0.2rem;
}

.block-editor-card-actions {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex-shrink: 0;
}

.block-editor-card-actions button {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--cream-300);
    background: #fff;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
}

.block-editor-card-actions button:hover:not(:disabled) {
    background: var(--sage-100);
    color: var(--sage-700);
}

.block-editor-card-actions button:disabled {
    opacity: 0.35;
    cursor: default;
}

.block-editor-add {
    margin-top: 0.2rem;
}

/* --- Parcours PHV (étape 6 en pages) --- */
.phv-wizard-stepper {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    padding: 1rem 1.2rem;
    background: #fff;
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-lg);
    margin-bottom: 1.2rem;
    overflow-x: auto;
}

.phv-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    width: 108px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.phv-wizard-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    background: var(--cream-300);
    color: var(--text-muted);
}

.phv-wizard-step.done .phv-wizard-circle {
    background: var(--sage-500);
    color: #fff;
}

.phv-wizard-step.active .phv-wizard-circle {
    background: var(--sage-800);
    color: #fff;
    box-shadow: 0 0 0 4px var(--sage-100);
}

.phv-wizard-label {
    font-size: 10.5px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
}

.phv-wizard-step.active .phv-wizard-label {
    color: var(--sage-800);
    font-weight: 600;
}

.phv-wizard-line {
    flex: 1;
    height: 2px;
    background: var(--cream-300);
    margin-top: 15px;
    min-width: 12px;
}

.phv-page {
    display: none;
}

.phv-page.active {
    display: block;
}

.phv-wizard-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1rem 0 1.5rem;
}

.phv-wizard-nav .phv-save-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Encart "dans le PHV précédent" */
.phv-history-box {
    padding: 0.7rem 0.9rem;
    background: #faf7f0;
    border: 1px dashed var(--cream-400);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
}

.phv-history-box .phv-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    gap: 0.6rem;
}

.phv-history-box .phv-history-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a7a5a;
}

.phv-history-box .phv-history-text {
    font-size: 0.82rem;
    color: #5a4f3a;
    line-height: 1.55;
    font-style: italic;
    white-space: pre-line;
}

.phv-history-box .phv-history-action {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--sage-600);
    cursor: pointer;
    white-space: nowrap;
    background: none;
    border: none;
    font-family: inherit;
}

.phv-history-box .phv-history-action:hover {
    color: var(--sage-800);
}

/* --- Empty state --- */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: var(--cream-400);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.88rem;
    margin-bottom: 1.5rem;
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-sage { color: var(--sage-600); }
.text-terra { color: var(--terra-500); }
.text-sm { font-size: 0.82rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: 0.5rem; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* --- Responsive --- */
@media (max-width: 1024px) {
    .sidebar {
        width: 220px;
    }
    .main-content {
        margin-left: 220px;
    }
    .stepper {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .step:not(:last-child)::after {
        width: 20px;
    }
    .form-row-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: min(260px, 82vw);
        transform: translateX(-100%);
        transition: var(--transition);
        z-index: 200;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-content {
        margin-left: 0;
    }
    .mobile-topbar {
        display: flex;
        align-items: center;
        gap: 1rem;
        padding: 0.9rem 1.2rem;
        background: var(--sage-800);
        color: var(--text-inverse);
        position: sticky;
        top: 0;
        z-index: 90;
    }
    .mobile-menu-btn {
        background: none;
        border: none;
        color: inherit;
        padding: 0.2rem;
        display: flex;
        cursor: pointer;
    }
    .mobile-topbar-brand {
        font-family: 'Playfair Display', serif;
        font-size: 1.1rem;
        font-weight: 700;
    }
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 150;
    }
    .sidebar-overlay.open {
        display: block;
    }
    .page-header {
        padding: 1.5rem;
    }
    .page-body {
        padding: 0 1.5rem 2rem;
    }
    /* Groupes de boutons (en-têtes de carte, actions de formulaire,
       sélecteurs...) : autoriser le retour à la ligne au lieu de
       déborder de l'écran quand plusieurs boutons ne tiennent pas
       sur une seule ligne. */
    .card-header,
    .form-actions,
    .d-flex {
        flex-wrap: wrap;
    }
    .btn {
        white-space: normal;
    }
    /* Tableau de lignes de facture (saisie) : exclu de la transformation
       en accordéon car éditable, mais toujours trop large pour un écran
       de téléphone. Il défile horizontalement dans sa carte. */
    .card-body:has(table.table-editable) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    table.table-editable {
        min-width: 500px;
    }
    .step-label {
        display: none !important;
    }
    .form-row-3 {
        grid-template-columns: 1fr;
    }
    /* Mises en page à deux colonnes (fiches, ressources, factures, stats...)
       écrites en style inline "2fr 1fr" : passent en une seule colonne. */
    [style*="grid-template-columns: 2fr 1fr"],
    [style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }
    /* Tableaux (clients, factures, dashboard, consultations...) :
       sur mobile, chaque ligne devient une carte à une seule colonne.
       Seule la 1re cellule reste visible ; un tap sur la ligne déplie
       les autres cellules en dessous (avec leur libellé de colonne,
       injecté par JS), et replie la ligne précédemment ouverte
       (voir initResponsiveTables() dans app.js). */
    /* .table-editable (ex: lignes de facture avec champs de saisie) garde
       sa mise en page normale : l'accordéon casserait la saisie mobile. */
    table.table:not(.table-editable) thead {
        display: none;
    }
    table.table:not(.table-editable),
    table.table:not(.table-editable) tbody,
    table.table:not(.table-editable) tr,
    table.table:not(.table-editable) td {
        display: block;
        width: 100%;
    }
    table.table:not(.table-editable) {
        border-collapse: separate;
    }
    table.table:not(.table-editable) tr {
        position: relative;
        background: #fff;
        border: 1px solid var(--cream-200);
        border-radius: var(--radius-md);
        margin-bottom: 0.7rem;
        padding: 0.85rem 2.2rem 0.85rem 1rem;
        cursor: pointer;
    }
    table.table:not(.table-editable) tr:hover td {
        background: transparent;
    }
    table.table:not(.table-editable) tr::after {
        content: '\203A';
        position: absolute;
        top: 0.75rem;
        right: 1rem;
        font-size: 1.4rem;
        line-height: 1;
        color: var(--text-light);
        transition: transform 0.2s;
    }
    table.table:not(.table-editable) tr.row-expanded::after {
        transform: rotate(90deg);
    }
    table.table:not(.table-editable) td {
        border: none !important;
        padding: 0.1rem 0 !important;
        white-space: normal;
        font-size: 0.9rem;
    }
    table.table:not(.table-editable) td:first-child {
        font-weight: 600;
    }
    table.table:not(.table-editable) td.row-hidden {
        display: none;
    }
    table.table:not(.table-editable) tr.row-expanded td.row-hidden {
        display: block;
        margin-top: 0.3rem;
    }
    table.table:not(.table-editable) td .row-detail-label {
        display: block;
        margin-top: 0.6rem;
        font-size: 0.68rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-muted);
    }
    table.table:not(.table-editable) td .row-detail-label:first-child {
        margin-top: 0;
    }
    table.table:not(.table-editable) tr.row-expanded td.row-hidden.actions {
        display: flex;
        flex-wrap: wrap;
        margin-top: 0.3rem;
    }
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.4s ease-out;
}

/* --- Print styles --- */
@media print {
    .sidebar, .page-header .btn, .stepper { display: none; }
    .main-content { margin: 0; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ============================================
   Système de suggestions intelligentes
   ============================================ */

/* Bouton pré-remplissage */
#phv-prefill-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#phv-prefill-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Recherche dans la base de connaissances */
.knowledge-search-card {
    background: linear-gradient(135deg, var(--sage-50) 0%, var(--cream-100) 100%);
    border: 1px solid var(--sage-200);
}

.knowledge-search-wrapper {
    position: relative;
}

#knowledge-search {
    padding-left: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237a8370' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 0.75rem center;
}

.knowledge-results {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--cream-300);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
    margin-top: 0.25rem;
}

.search-results-list {
    padding: 0.5rem;
}

.search-result-item {
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    background: var(--cream-50);
    border: 1px solid var(--cream-200);
    transition: all 0.2s ease;
}

.search-result-item:hover {
    background: var(--sage-50);
    border-color: var(--sage-300);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.search-result-section {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--sage-600);
    background: var(--sage-100);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.search-result-path {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-result-content {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
}

.search-result-item .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.search-no-results {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
}

/* Notifications */
.notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    transform: translateX(120%);
    transition: transform 0.3s ease;
    max-width: 400px;
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-error {
    border-left: 4px solid var(--danger);
}

.notification-info {
    border-left: 4px solid var(--info);
}

.notification-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.notification-close:hover {
    color: var(--text-primary);
}

/* Bouton sage */
.btn-sage {
    background: var(--sage-500);
    color: white;
    border: none;
}

.btn-sage:hover {
    background: var(--sage-600);
}

.btn-sage:disabled {
    background: var(--sage-300);
    cursor: not-allowed;
}

/* ============================================
   PHV - Génération automatique
   ============================================ */

/* Section auto-générée */
.auto-content-section {
    margin-bottom: 0.75rem;
}

.auto-content-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--sage-700);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.auto-content-label.text-danger {
    color: var(--danger);
}

.auto-content-label.text-success {
    color: var(--success);
}

.auto-content-box {
    background: var(--cream-50);
    border: 1px solid var(--cream-300);
    border-left: 3px solid var(--sage-400);
    border-radius: var(--radius-sm);
    padding: 1rem 1.2rem;
    font-size: 0.88rem;
    line-height: 1.65;
    color: var(--text-secondary);
    white-space: pre-line;
}

.auto-content-box-small {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    min-height: 120px;
}

/* Commentaire praticien */
.praticien-comment {
    background: var(--sage-50);
    border-radius: var(--radius-sm);
    padding: 1rem;
    border: 1px dashed var(--sage-300);
}

.praticien-comment .form-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--sage-700);
    font-size: 0.8rem;
}

.praticien-comment .form-label svg {
    color: var(--sage-500);
}

.praticien-comment .form-control {
    background: white;
    font-size: 0.88rem;
}

/* Compléments auto-générés */
.complements-auto-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.complement-auto-item {
    background: var(--cream-50);
    border: 1px solid var(--cream-300);
    border-left: 3px solid var(--terra-400);
    border-radius: var(--radius-sm);
    padding: 1rem;
}

.complement-auto-nom {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--sage-800);
    margin-bottom: 0.4rem;
}

.complement-auto-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.complement-auto-poso::before {
    content: "📋 ";
}

.complement-auto-duree::before {
    content: "⏱️ ";
}

.complement-auto-raison {
    margin-top: 0.4rem;
    font-style: italic;
    color: var(--text-muted);
}

/* Badge danger pour stress élevé */
.badge-danger {
    background: #fde8e6;
    color: var(--danger);
}

/* ============================================
   Modaux
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.2rem 1.5rem;
    border-bottom: 1px solid var(--cream-200);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--cream-200);
    background: var(--cream-50);
}

/* ============================================
   Calendrier / Agenda
   ============================================ */

/* Vue Mois */
.calendar-month {
    padding: 1rem;
}

.calendar-header-row {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--cream-200);
    margin-bottom: 0.5rem;
}

.calendar-header-cell {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.calendar-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
    min-height: 100px;
    padding: 0.5rem;
    border: 1px solid var(--cream-100);
    background: white;
    transition: var(--transition);
}

.calendar-day:hover {
    background: var(--sage-50);
}

.calendar-day.empty {
    background: var(--cream-50);
}

.calendar-day.today {
    background: var(--sage-50);
    border-color: var(--sage-300);
}

.day-number {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.calendar-day.today .day-number {
    color: var(--sage-700);
}

.day-event {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-bottom: 0.2rem;
    font-size: 0.7rem;
    cursor: pointer;
    border-left: 3px solid;
    transition: var(--transition);
}

.day-event:hover {
    transform: translateX(2px);
}

.event-time {
    font-weight: 600;
    margin-right: 0.3rem;
}

.event-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.day-more {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Vue Semaine */
.calendar-week-view {
    overflow-x: auto;
}

.week-header {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    background: var(--sage-50);
    border-bottom: 2px solid var(--cream-200);
}

.week-time-col {
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: right;
    border-right: 1px solid var(--cream-200);
}

.week-day-header {
    padding: 0.8rem 0.5rem;
    text-align: center;
    border-right: 1px solid var(--cream-200);
}

.week-day-header.today {
    background: var(--sage-100);
}

.week-day-header .day-name {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    display: block;
}

.week-day-header .day-num {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--sage-700);
}

.week-body {}

.week-row {
    display: grid;
    grid-template-columns: 60px repeat(7, 1fr);
    border-bottom: 1px solid var(--cream-100);
}

.week-cell {
    min-height: 50px;
    padding: 0.2rem;
    border-right: 1px solid var(--cream-100);
    position: relative;
}

.week-cell.today {
    background: rgba(74, 103, 65, 0.03);
}

.week-cell:hover {
    background: var(--sage-50);
    cursor: pointer;
}

.week-event {
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    color: white;
    font-size: 0.75rem;
    cursor: pointer;
    margin-bottom: 0.2rem;
}

.week-event:hover {
    opacity: 0.9;
}

.event-client {
    font-weight: 500;
}

/* Vue Jour */
.calendar-day-view {}

.day-header {
    padding: 1rem;
    background: var(--sage-50);
    border-bottom: 2px solid var(--cream-200);
}

.day-header h3 {
    margin: 0;
}

.day-timeline {
    padding: 0 1rem;
}

.timeline-hour {
    display: flex;
    border-bottom: 1px solid var(--cream-100);
    min-height: 60px;
}

.hour-label {
    width: 60px;
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: right;
    flex-shrink: 0;
}

.hour-slot {
    flex: 1;
    position: relative;
    padding: 0.2rem;
    border-left: 1px solid var(--cream-200);
}

.hour-slot:hover {
    background: var(--sage-50);
    cursor: pointer;
}

.timeline-event {
    position: absolute;
    left: 4px;
    right: 4px;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
}

.timeline-event:hover {
    box-shadow: var(--shadow-md);
}

.timeline-event .event-content {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* ============================================
   Badges supplémentaires
   ============================================ */
.badge-secondary {
    background: var(--cream-200);
    color: var(--text-secondary);
}

/* ============================================
   Bouton Success
   ============================================ */
.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #3d8a4a;
    color: white;
}

/* ============================================
   Liens dans le vue client
   ============================================ */
.client-nav-links {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--cream-50);
    border-radius: var(--radius-sm);
}

.client-nav-links a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
}

.client-nav-links a:hover {
    background: var(--sage-100);
    color: var(--sage-700);
}

.client-nav-links a.active {
    background: var(--sage-500);
    color: white;
}

/* ============================================
   Responsive tablette
   ============================================ */
@media (max-width: 1024px) {
    .calendar-day {
        min-height: 80px;
    }

    .week-cell {
        min-height: 40px;
    }

    .modal-content {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .calendar-header-cell {
        font-size: 0.65rem;
    }

    .calendar-day {
        min-height: 60px;
        padding: 0.25rem;
    }

    .day-number {
        font-size: 0.8rem;
    }

    .day-event {
        font-size: 0.6rem;
        padding: 0.1rem 0.2rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Barre de navigation de l'agenda (< Aujourd'hui > / Jour Semaine Mois) :
       trop de boutons pour une seule ligne sur mobile, on la laisse
       revenir à la ligne au lieu de déborder. */
    .calendar-nav .card-body {
        flex-wrap: wrap;
        gap: 0.6rem;
    }
    /* Grille (et non flex) pour forcer 3 tiers strictement égaux qui
       tiennent toujours sur l'écran, sans dépendre de la largeur du
       texte des boutons (qui pourrait empêcher le retour à la ligne
       et faire déborder "Mois" hors de l'écran). */
    .calendar-nav .vue-selector {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        width: 100%;
        gap: 0.4rem;
    }
    .calendar-nav .vue-selector a {
        min-width: 0;
        padding: 0.5rem 0.3rem;
        text-align: center;
    }

    /* Vue semaine : tout doit tenir dans la largeur de l'écran, sans
       défilement ni zoom. Les colonnes se compressent (1fr) et les
       textes se réduisent en conséquence. */
    .week-header,
    .week-row {
        grid-template-columns: 32px repeat(7, 1fr);
    }
    .week-time-col {
        padding: 0.3rem 0.1rem;
        font-size: 0.62rem;
    }
    .week-day-header {
        padding: 0.4rem 0.1rem;
        min-width: 0;
    }
    .week-cell {
        min-width: 0;
        padding: 0.1rem;
    }
    .week-day-header .day-name {
        font-size: 0.6rem;
    }
    .week-day-header .day-num {
        font-size: 0.95rem;
    }
    .week-event {
        padding: 0.15rem 0.2rem;
        font-size: 0.6rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .week-event .event-time {
        display: none;
    }
}

/* ============================================
   RÉCAPITULATIF GLOBAL PRATICIEN
   ============================================ */

.recap-global .card-header {
    background: linear-gradient(135deg, var(--sage-600), var(--sage-700));
    color: white;
}

.recap-global .card-header h3 {
    color: white;
}

.recap-global .card-header svg {
    stroke: white;
}

.recap-section {
    border: 1px solid var(--cream-300);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    background: var(--cream-50);
    overflow: hidden;
}

.recap-section:last-child {
    margin-bottom: 0;
}

.recap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--cream-200);
    border-bottom: 1px solid var(--cream-300);
}

.recap-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--sage-700);
}

.recap-content {
    padding: 1rem;
}

.recap-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.recap-row:last-child {
    margin-bottom: 0;
}

.recap-label {
    font-weight: 500;
    color: var(--text-secondary);
    min-width: 120px;
    flex-shrink: 0;
}

.recap-value {
    color: var(--text-primary);
    word-break: break-word;
}

/* Scores */
.recap-scores {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.recap-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.recap-score .score-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.score-badge.score-low {
    background: var(--sage-100);
    color: var(--sage-700);
}

.score-badge.score-medium {
    background: #fef3cd;
    color: #856404;
}

.score-badge.score-high {
    background: #f8d7da;
    color: #721c24;
}

/* Badges */
.recap-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Priorités */
.recap-priorities {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recap-priority {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.priority-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--terra-500);
    color: white;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: 600;
    flex-shrink: 0;
}

.priority-text {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

/* Notes praticien */
.recap-notes {
    background: #fff9e6;
    border-color: #ffe066;
}

.recap-notes .recap-header {
    background: #fff3cd;
    border-color: #ffe066;
}

.recap-notes .recap-header h4 {
    color: #856404;
}

/* RDV */
.recap-rdv .recap-content {
    padding: 0.75rem 1rem;
}

.recap-rdv .form-row {
    margin: 0;
    gap: 1rem;
}

.recap-rdv .form-group {
    margin: 0;
}

/* PHV Summary */
.recap-phv-summary .recap-row {
    padding: 0.25rem 0;
    border-bottom: 1px dashed var(--cream-300);
}

.recap-phv-summary .recap-row:last-child {
    border-bottom: none;
}

/* Responsive */
@media (max-width: 768px) {
    .recap-row {
        flex-direction: column;
        gap: 0.25rem;
    }

    .recap-label {
        min-width: auto;
    }

    .recap-scores {
        justify-content: center;
    }

    .recap-rdv .form-row {
        flex-direction: column;
    }
}
