@charset "utf-8";

/* ============================================
   iManage UI — Apple-inspired design system
   ============================================ */

/* ============================================================
   SYSTÈME DE TOKENS UNIFIÉ — design simple / épuré / moderne
   ────────────────────────────────────────────────────────────
   Une SEULE source de vérité. Les composants ne hardcodent plus
   ni couleur, ni rayon, ni ombre, ni durée : tout passe par ces tokens.
   Une app ne surcharge QUE --accent / --accent-hover dans son app.css.
   ============================================================ */
:root {
	/* Schéma clair explicite : évite que les contrôles natifs (scrollbars,
	   date pickers…) suivent un OS en dark alors que l'app est en light.
	   Surchargé en `dark` par theme-toggle.css. */
	color-scheme: light;

	/* ── 1. Couleurs de base (système Apple = canonique) ── */
	--bg-primary:      #f5f5f7;            /* fond d'app */
	--bg-surface:      #ffffff;            /* cartes, modals, panels (le « papier ») */
	--bg-content:      #f0f0f3;            /* inputs, zones enfoncées, input-group */
	--bg-subtle:       #fafafa;            /* alternance subtile (remplace les Slate #f8fafc/#f1f5f9) */
	--bg-navbar:       rgba(251, 251, 253, 0.80);
	--text-primary:    #1d1d1f;            /* titres, texte fort */
	--text-secondary:  #6e6e73;            /* texte secondaire — WCAG AA 5.9:1 sur blanc */
	--text-tertiary:   #8e8e93;            /* texte muet, placeholder */
	--border:          rgba(0, 0, 0, 0.10);
	--border-strong:   rgba(0, 0, 0, 0.16);
	--separator:       1px solid var(--border);

	/* ── 2. Accent (UN SEUL — écrase les faux #00B4D8 et #0F766E) ── */
	--accent:          #1fb4c5;            /* surchargé par app.css */
	--accent-hover:    #18a0b0;
	--accent-soft:     color-mix(in srgb, var(--accent) 12%, transparent);  /* fonds teintés */
	--accent-border:   color-mix(in srgb, var(--accent) 24%, transparent);
	--text-on-accent:  #ffffff;            /* texte sur fond accent */

	/* ── 3. Status sémantiques (base + -soft pour les fonds) ── */
	--status-info:     #2563eb;  --status-info-soft:    color-mix(in srgb, var(--status-info) 10%, transparent);
	--status-success:  #059669;  --status-success-soft: color-mix(in srgb, var(--status-success) 10%, transparent);
	--status-warning:  #d97706;  --status-warning-soft: color-mix(in srgb, var(--status-warning) 10%, transparent);
	--status-danger:   #dc2626;  --status-danger-soft:  color-mix(in srgb, var(--status-danger) 10%, transparent);
	--color-admin:     #6366f1;            /* badge démo / admin */

	/* ── 4. Surfaces sombres (toasts, notifications, overlays) ── */
	--bg-notification: rgba(29, 29, 31, 0.94);
	--text-on-dark:    #f5f5f7;
	--overlay:         rgba(0, 0, 0, 0.32); /* backdrops modals / drawers */
	--opacity-muted:     0.55;             /* échelle d'opacité texte-sur-sombre, 3 crans */
	--opacity-secondary: 0.75;
	--opacity-strong:    0.92;

	/* ── 5. Rayons (vraie échelle — 6 crans distincts) ── */
	--radius-xs:    4px;    /* badges, chips, scrollbars, micro-éléments */
	--radius-sm:    6px;    /* boutons, inputs, selects, menu-items, icon-buttons */
	--radius-md:    10px;   /* cartes, panels, dropdowns, modals standard */
	--radius-lg:    14px;   /* overlays, drawers, bannières, gros conteneurs */
	--radius-xl:    20px;   /* modal hero (login) uniquement */
	--radius-full:  999px;  /* pills, badges arrondis */
	--radius:       var(--radius-md);  /* alias historique (certains app.css l'emploient) */

	/* ── 6. Élévation (ombres NEUTRES — jamais teintées accent/status) ── */
	--shadow-xs:    0 1px 2px rgba(0, 0, 0, 0.05);
	--shadow-sm:    0 1px 3px rgba(0, 0, 0, 0.08);
	--shadow-md:    0 4px 12px rgba(0, 0, 0, 0.08);
	--shadow-lg:    0 8px 24px rgba(0, 0, 0, 0.12);
	--shadow-focus: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);

	/* ── 7. Transitions (même easing, 3 durées) ── */
	--transition-fast: 0.15s cubic-bezier(0.25, 0.1, 0.25, 1);  /* hover, focus, couleur */
	--transition:      0.25s cubic-bezier(0.25, 0.1, 0.25, 1);  /* états, transform/opacity */
	--transition-slow: 0.4s  cubic-bezier(0.22, 1, 0.36, 1);    /* entrées panels/drawers */

	/* ── 8. Typographie — RÈGLE iManage (nombre d'or) ─────────────────────────
	   R = MENU = 13px (--font-size-menu) est la RÉFÉRENCE.
	   • Tout le contenu de page (corps, libellés, tableaux, sous-titres) est PLUS PETIT
	     que le menu : ≤ 12px. Le 13px est réservé au menu/chrome.
	   • Seuls les TITRES dépassent le menu, plafonnés à R × φ(1.618) = 21px (--font-size-xl).
	   Échelle (facteurs de φ) :  10 / 11 / 12 (contenu)  ·  13 (menu = R = PLAFOND contenu)
	   ·  21 (R×φ) / 34 (R×φ²) = TITRES uniquement.                                      ── */
	--phi: 1.618;                                   /* nombre d'or */
	--font-size-xs:   10px;   /* méta : séparateurs, micro-libellés */
	--font-size-sm:   11px;   /* libellés, captions, texte secondaire */
	--font-size-base: 12px;   /* CORPS de page (défaut) — < menu */
	--font-size-md:   12px;   /* corps confortable (= base) */
	--font-size-menu: 13px;   /* MENU = R = PLAFOND de TOUT contenu (champs, dropdowns, boutons, cellules) */
	--font-size-lg:   13px;   /* plafonné au menu : aucune taille de contenu entre 13 et 21 ; sous-titres ≤ menu (hiérarchie par graisse) */
	--font-size-xl:   21px;   /* R × φ — titres de page */
	--font-size-display: 34px;/* R × φ² — grands titres / hero (rare) */
	--font-size-title: var(--font-size-xl);         /* alias sémantique (21px) */
	--font-weight-medium:   500;
	--font-weight-semibold: 600;

	/* ── 9. Espacement (échelle 4px) ── */
	--spacing-xs:  4px;
	--spacing-sm:  8px;
	--spacing-md:  12px;
	--spacing-lg:  16px;
	--spacing-xl:  20px;
	--spacing-2xl: 24px;

	/* ── 10. Réconciliation Slate → Apple (alias, même valeur que le canon) ──
	   Garde les anciens noms vivants ; tous pointent vers le système Apple.
	   Les composants migrés utilisent directement les tokens canoniques ;
	   ces alias couvrent le legacy le temps de finir la migration. */
	--ink:           var(--text-primary);
	--mute:          var(--text-secondary);
	--muted:         var(--text-secondary);
	--line:          var(--border);
	--surf:          var(--bg-surface);
	--paper:         var(--bg-surface);
	--soft:          var(--bg-subtle);
	--softer:        var(--bg-subtle);
	--accent-dark:   var(--accent-hover);
	--border-color:  var(--border);
	--text-light:    var(--text-tertiary);
	--text-muted:    var(--text-secondary);
	--text-disabled: #cbd5e1;
	/* namespace legacy list-view / tile-view — aliasés puis à retirer */
	--lv-ink:   var(--text-primary);   --lv-mute:   var(--text-secondary);
	--lv-line:  var(--border);         --lv-surf:   var(--bg-surface);
	--lv-cyan:  var(--accent);         --lv-accent: var(--accent-hover);
}

* { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

html { background: var(--bg-surface); }
body {
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Arial, sans-serif;
	/* PAS de background sur body — il doit rester transparent pour que
	   body::after (l'overlay 2-tons en position:fixed, z-index:-1) soit visible.
	   Le fond plein est porté par <html>. */
	background: transparent !important;
	color: var(--text-primary);
	letter-spacing: -0.01em;
	font-size: var(--font-size-base);   /* RÈGLE iManage : corps de page = 12px (< menu 13px) */
	padding-top: 48px;
	position: relative;
	/* Overlay 2-tons : split-screen comme Cambatani — gauche claire (7/12),
	   droite légèrement plus sombre (5/12). Rehaussé à ~7% noir (light)
	   pour rendre la séparation clairement perceptible. En dark mode,
	   theme-toggle.css inverse à blanc 9% pour éclaircir au lieu d'assombrir. */
	--body-tone-overlay: rgba(15, 23, 42, 0.07);
}
/* Postulat iManage : body 2 tons — 7/12 gauche (clair) · 5/12 droite (légèrement plus sombre).
   La teinte est portée par --body-tone-overlay pour permettre l'override dark. */
body::after {
	content: '';
	position: fixed;
	top: 0; right: 0; bottom: 0;
	width: calc(100vw * 5 / 12);   /* 5/12 ≈ 41.67 % côté droit */
	background: var(--body-tone-overlay);
	z-index: -1;
	pointer-events: none;
}

/* ── Titres — RÈGLE NOMBRE D'OR ───────────────────────────────────────
   Bootstrap rend h1-h6 jusqu'à 2.5rem (40px) : on CAPE tout sous la règle.
   Maximum absolu = menu(13px) × φ(1.618) = 21px (--font-size-xl), pour h1 / titre
   de page UNIQUEMENT. Seuls h1-h3 dépassent le menu (ce sont des titres) ;
   h4-h6 restent ≤ menu. AUCUN texte de l'app ne dépasse le menu hors titres.
   On inclut les classes utilitaires .h1-.h6 (spécificité Bootstrap). */
h1, .h1 { font-size: var(--font-size-xl);   font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
h2, .h2 { font-size: var(--font-size-lg);   font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; }
h3, .h3 { font-size: var(--font-size-menu); font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
h4, .h4 { font-size: var(--font-size-menu); font-weight: 600; line-height: 1.4; }
h5, .h5 { font-size: var(--font-size-base); font-weight: 600; line-height: 1.4; }
h6, .h6 { font-size: var(--font-size-sm);   font-weight: 600; line-height: 1.4; }
/* Garde-fou ultime : aucune police de l'app ne peut dépasser le maximum φ.
   .display-* et gros utilitaires Bootstrap sont ramenés au plafond. */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
	font-size: var(--font-size-xl);
	font-weight: 600;
}

/* ---- Page header (calendar zone) ----
   Zone entre la navbar et le contenu, masquée par défaut (max-height animé),
   affichée quand l'app active le calendrier (.visible).
   Dégradé léger pour se distinguer visuellement de la navbar. */
#page_header {
	display: flex;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	padding: 0;
	background: linear-gradient(to bottom, #ffffff, var(--bg-primary));
	transition: max-height .3s ease, opacity .3s ease, padding .3s ease;
}

#page_header.visible,
#page_header.always-visible {
	max-height: 80px;
	opacity: 1;
	padding: 12px 0;
	overflow: visible;
}

/* Mode always-visible : utilisé par les apps où le calendrier fait partie intégrante
   de l'écran (ex: change de devises). Ajouter .always-visible sur le #page_header
   dans le template de l'app plutôt que d'override en CSS. */

#page_header .container,
#page_header .container-fluid {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Icônes du date picker dans la zone calendrier — gris neutre (pas l'accent)
   pour ne pas attirer trop l'attention sur un widget secondaire. */
.date-container .fa-solid,
.date-container .fa-regular {
	color: var(--text-muted, #94a3b8);
	cursor: pointer;
	transition: color .15s;
}
.date-container .fa-solid:hover,
.date-container .fa-regular:hover {
	color: var(--text-primary, #0f172a);
}
/* Texte de la date (weekday / date / year) — affiché en gris foncé,
   weight 500 pour rester lisible sans dominer. */
.date-container .weekday,
.date-container .date,
.date-container .year {
	color: var(--text-primary, #0f172a);
	font-weight: 500;
	margin: 0 4px;
}
.date-container .weekday::after { content: ' '; }
/* Espacement cohérent dans le datepicker — flexbox pour centrage propre. */
.date-container {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 4px 12px;
	border-radius: 6px;
}

#page_content {
	padding-top: 16px;
	padding-bottom: 60px;
}

#requested_content {
	padding-top: 0;
	padding-bottom: 0;
}

#page_header.visible + #page_content {
	padding-top: 0;
}

.panel-section-sticky {
	position: sticky;
	top: 134px;
}

/* Styles #page_footer portés par le composant page-footer.css */

/* ════════════════════════════════════════════════
   Scrollbar discrète (WebKit)
   ════════════════════════════════════════════════ */
::-webkit-scrollbar         { width: 6px; height: 6px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: rgba(0, 0, 0, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.3); }

/* ════════════════════════════════════════════════
   Dashboard (.dashboard-v3) — structure commune
   Les apps peuvent ajouter leurs propres extensions (KPIs spécifiques,
   cards métier, etc.) dans leur app.css. Cette base fournit hero, kpis,
   cards et feed. La couleur d'accent est automatiquement var(--accent).
   ════════════════════════════════════════════════ */
.dashboard-v3 {
    /* Les --d-* sont l'interface stable consommée par les sélecteurs du framework.
       Chaque variable hérite du namespace projet (--ink, --mute, --line, --surf,
       --soft, --softer) avec un fallback light-mode. Conséquence : si un projet
       (ou son theme-toggle.css en mode sombre) redéfinit --ink/--surf/etc., le
       dashboard s'adapte automatiquement sans toucher au framework. */
    --d-ink:    var(--ink,    #0f172a);
    --d-mute:   var(--mute,   #64748b);
    --d-line:   var(--line,   #e2e8f0);
    --d-surf:   var(--surf,   #ffffff);
    --d-soft:   var(--soft,   #f8fafc);
    --d-softer: var(--softer, #f1f5f9);
    --d-accent: var(--accent);

    color: var(--d-ink);
    font-size: var(--font-size-base);
    line-height: 1.5;
}
.dashboard-v3 h2 {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--d-ink);
    letter-spacing: -0.01em;
}
.dashboard-v3 h6.g-card-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--d-mute);
    margin: 0 0 12px;
}

/* ═════════════════════════════════════════════════════════════════
   Hero — bandeau d'accueil
   Structure attendue (templates des projets) :
     <section class="g-hero">
       <div class="g-hero-body">
         <div class="g-hero-greeting">Bonjour…</div>
         <div class="g-hero-subtitle">DBA · 20 mai 2026</div>
       </div>
       <div class="g-clinic-badge|g-clinic-selector">…</div>   (optionnel)
     </section>

   Design canonique : carte arrondie avec gradient subtil, contenu à gauche,
   actions/badge à droite. Bénéficie aux 9 projets iManage.

   Alias backward-compat : .g-hello, .g-role-pill, .g-hint restent supportés.
   ═════════════════════════════════════════════════════════════════ */
.dashboard-v3 .g-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--d-soft), var(--d-surf));
    border: 1px solid var(--d-line);
    border-radius: 10px;
}
.dashboard-v3 .g-hero-body,
.dashboard-v3 .g-hello { min-width: 0; flex: 1; }
.dashboard-v3 .g-hero-greeting {
    font-size: var(--font-size-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--d-ink);
    margin-bottom: 4px;
}
.dashboard-v3 .g-hero-subtitle {
    font-size: var(--font-size-base);
    color: var(--d-mute);
    line-height: 1.4;
}
.dashboard-v3 .g-role-pill {
    display: inline-block;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--d-accent);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin: 0 0 8px;
}
.dashboard-v3 .g-hint {
    font-size: var(--font-size-base);
    color: var(--d-ink);
    margin: 0;
    opacity: 0.85;
}

/* ═════════════════════════════════════════════════════════════════
   KPI strip — design canonique iManage v2
   Structure attendue (générée par les templates de chaque projet) :
     <div class="g-kpis">
       <div class="g-kpi-card">
         <div class="g-kpi-head">
           <span class="g-kpi-label">Label</span>
           <span class="g-kpi-period">Période</span>
         </div>
         <div class="g-kpi-value">1234<span class="g-kpi-box-unit">FC</span></div>
       </div>
     </div>

   Règles inviolables :
   1. La valeur (montant) n'est JAMAIS tronquée (pas de text-overflow:ellipsis).
   2. Le label/période est en ligne 1, le montant en ligne 2.
   3. Les cards s'élargissent pour contenir le montant ; si l'espace manque,
      elles wrappent sur une nouvelle ligne (jamais de débordement horizontal).

   Bénéficie aux 9 projets iManage. Une app peut surcharger via son app.css
   (variables --d-* ou règles spécifiques) sans toucher au layout de base.
   ═════════════════════════════════════════════════════════════════ */
.dashboard-v3 .g-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}
.dashboard-v3 .g-kpi-card {
    background: var(--d-surf);
    border: 1px solid var(--d-line);
    border-radius: 10px;
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    transition: box-shadow .12s ease, transform .12s ease;
}
.dashboard-v3 .g-kpi-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Ligne 1 — Label (gauche) + période (droite) */
.dashboard-v3 .g-kpi-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
    min-width: 0;
}
.dashboard-v3 .g-kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--d-mute);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.dashboard-v3 .g-kpi-period {
    margin-left: auto;
    font-size: 10px;
    color: var(--d-mute);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Ligne 2 — Montant intégral (jamais tronqué) */
.dashboard-v3 .g-kpi-value {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--d-ink);
    line-height: 1.1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    /* PAS de overflow:hidden / text-overflow:ellipsis : un montant tronqué = bug métier */
}
.dashboard-v3 .g-kpi-box-unit {
    font-size: var(--font-size-base);
    font-weight: 500;
    opacity: 0.6;
    margin-left: 4px;
}
.dashboard-v3 .g-kpi-hint { font-size: 12px; color: var(--d-mute); margin-top: 4px; }

/* Icône optionnelle — affichée seulement si un projet l'ajoute via son template */
.dashboard-v3 .g-kpi-icon {
    flex-shrink: 0;
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--d-softer);
    border-radius: 8px;
    color: var(--d-accent);
    font-size: 14px;
    margin-bottom: 8px;
}

/* ═════════════════════════════════════════════════════════════════
   Cards de section — structure canonique
   Structure attendue :
     <section class="g-card">
       <div class="g-card-head">
         <h4>Titre</h4>
         <span class="g-pill-sm">5</span>     (optionnel — compteur)
       </div>
       <!-- contenu (table, liste, etc.) directement -->
     </section>

   Bénéficie aux 9 projets iManage. Backward-compat : .g-card-body reste
   supporté pour les anciens templates qui wrappent leur contenu dedans.
   ═════════════════════════════════════════════════════════════════ */
.dashboard-v3 .g-card {
    background: var(--d-surf);
    border: 1px solid var(--d-line);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}
.dashboard-v3 .g-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--d-line);
}
.dashboard-v3 .g-card-head h4 {
    font-size: var(--font-size-lg);
    font-weight: 600;
    margin: 0;
    color: var(--d-ink);
}
.dashboard-v3 .g-pill-sm {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    background: var(--d-softer);
    color: var(--d-mute);
    border: 1px solid var(--d-line);
}

/* Backward-compat : ancien wrapper g-card-body avec padding intégré */
.dashboard-v3 .g-card-body { font-size: var(--font-size-base); padding: 16px; }
.dashboard-v3 .g-card-body .table { margin-bottom: 0; }
.dashboard-v3 .g-card-body .table th {
    font-size: .72rem !important;
    color: var(--d-mute) !important;
    font-weight: 600 !important;
    border-bottom: 1px solid var(--d-line);
    padding: 8px 10px;
}
.dashboard-v3 .g-card-body .table td {
    padding: 8px 10px;
    border-top: 1px solid var(--d-line);
    vertical-align: middle;
}

/* Table compacte dans une g-card (.g-table) */
.dashboard-v3 .g-table { width: 100%; border-collapse: collapse; font-size: var(--font-size-base); }
.dashboard-v3 .g-table thead th {
    padding: 10px 14px 8px;
    font-size: 11px;
    font-weight: 600;
    color: var(--d-mute);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-align: left;
    border-bottom: 1px solid var(--d-line);
}
.dashboard-v3 .g-table tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--d-line);
    vertical-align: middle;
}
.dashboard-v3 .g-table tbody tr:last-child td { border-bottom: 0; }
.dashboard-v3 .g-table tbody tr:hover { background: var(--d-soft); }

/* État vide dans une g-card */
.dashboard-v3 .g-card-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    color: var(--d-mute);
    font-size: var(--font-size-base);
}
.dashboard-v3 .g-empty-ico {
    width: 32px; height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    color: var(--d-accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* Activité / feed */
.dashboard-v3 .g-feed { list-style: none; padding: 0; margin: 0; }
.dashboard-v3 .g-feed-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--d-line);
}
.dashboard-v3 .g-feed-item:last-child { border-bottom: none; }
.dashboard-v3 .g-feed-icon {
    width: 28px; height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--d-softer);
    color: var(--d-accent);
    border-radius: 6px;
    font-size: 12px;
    flex-shrink: 0;
}
.dashboard-v3 .g-feed-main { flex: 1; min-width: 0; }
.dashboard-v3 .g-feed-label {
    font-weight: 500;
    color: var(--d-ink);
    font-size: var(--font-size-base);
}

/* ════════════════════════════════════════════════
   Status — deux patterns distincts
   · .status-box  : carré 32x32 avec abréviation 3 lettres (colonnes compactes)
   · .status-pill : pill icône + texte (lisible en N&B, a11y colorblind)
   La couleur de fond est fournie par les classes .badge-* de l'app.
   ════════════════════════════════════════════════ */
.status-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #fff;
    font-weight: 700;
    font-size: .6rem;
    padding: 0;
    text-align: center;
    line-height: 1;
    letter-spacing: .02em;
}

/* Pill accessible — icône + libellé. L'icône double le signal de la couleur
   pour les malvoyants et le mode N&B (accessibility guideline 1.4.1). */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: #fff;
}
.status-pill > .fa-solid,
.status-pill > .fa-regular {
    font-size: 10px;
}

/* ════════════════════════════════════════════════
   Bootstrap overrides standard iManage
   (les couleurs de marque sont définies dans app.css de chaque projet)
   ════════════════════════════════════════════════ */
.alert {
	border: none;
	border-radius: var(--radius-sm);
	font-weight: 500;
}

.nav-tabs .nav-link {
	border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.nav-pills .nav-link.active {
	background: var(--accent);
}

.login-brand-logo {
	width: 60%;
	max-width: 160px;
	height: auto;
}

.form-control {
	border-radius: var(--radius-sm);
	border: 1px solid rgba(0, 0, 0, 0.12);
	padding: 8px 12px;
	transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus {
	border-color: var(--accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* Focus visible au clavier — a11y. Affiche un anneau sur les éléments
   focussés UNIQUEMENT via Tab (pas au clic souris). */
:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* Retire l'outline par défaut sur clic souris — garde focus-visible au clavier */
:focus:not(:focus-visible) {
	outline: none;
}

.form-select {
	border-radius: var(--radius-sm);
}

/* ── PLAFOND TYPOGRAPHIQUE (nombre d'or) ──────────────────────────────────
   RÈGLE iManage : AUCUN contenu ne dépasse le menu (R = 13px). Bootstrap impose
   1rem (champs/boutons), .875rem (-sm) et 1.25rem (-lg) → on neutralise ici, une
   fois pour toutes, pour TOUS les projets. Le menu (.nav-link) et les titres
   (h1/.h1, --font-size-xl/-title/-display) ne sont volontairement PAS concernés. */
.form-control, .form-select,
.form-control-sm, .form-select-sm,
.form-control-lg, .form-select-lg,
.btn, .btn-sm, .btn-lg,
.input-group-text, .dropdown-item {
	font-size: var(--font-size-base);
}

.table thead th {
	font-weight: 600;
	font-size: .78rem;
	text-transform: capitalize;
	letter-spacing: 0.02em;
	color: var(--text-secondary);
}

.table td {
	vertical-align: top;
	border-color: var(--border);
	padding: 10px 12px;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
	background-color: rgba(0, 0, 0, 0.025);
}

.table-sm td, .table-sm th {
	padding: 6px 10px;
}

div.dataTables_info,
.dataTables_info {
	color: var(--text-secondary) !important;
	font-size: .72rem !important;
}

div.dataTables_length,
div.dataTables_length label,
.dataTables_length,
.dataTables_length label {
	font-size: .72rem !important;
	color: var(--text-secondary) !important;
}

div.dataTables_length select,
.dataTables_length select {
	font-size: .72rem !important;
}

div.dataTables_filter,
div.dataTables_filter label,
.dataTables_filter,
.dataTables_filter label {
	font-size: .72rem !important;
	color: var(--text-secondary) !important;
}

div.dataTables_filter input,
.dataTables_filter input {
	font-size: .78rem !important;
}

.table td .btn,
.table th .btn {
	padding-left: 10px;
	padding-right: 10px;
}

.table td .fa-solid,
.table td .fa-regular {
	padding: 0 4px;
}

strong.detail-link {
	color: var(--accent);
	cursor: pointer;
}

strong.detail-link:hover {
	text-decoration: underline;
}

.content-title {
	font-size: var(--font-size-xl);
	font-weight: 700;
	color: var(--text-primary);
	background: transparent;       /* pas de couleur de fond */
	margin: 16px 0;
	padding: 0;                    /* pas de padding interne */
	border-radius: 0;
	display: flex;
	align-items: center;
	gap: 8px;
}

.content-title .content-title-actions {
	margin-left: auto;
}

.content-title small {
	font-weight: 500;
	color: var(--text-secondary);
	letter-spacing: 0;
	margin-left: 10px;
}

/* Convention v3.4.1 (2026-05-21) : titre sans icône, sous-titre sur sa propre ligne.
   Tous les projets doivent utiliser :
       <h3 class="content-title">Titre</h3>
       <p  class="content-subtitle">Sous-titre…</p>
   au lieu de mettre l'icône et le sous-titre dans le <h3>. */
.content-subtitle {
	color: var(--text-secondary);
	font-size: var(--font-size-base);
	font-weight: 400;
	line-height: 1.4;
	margin: 0 0 16px;
}
.content-subtitle:empty { display: none; }
/* Si une icône traîne dans un .content-title (legacy), on la neutralise — la
   convention v3.4.1 interdit les icônes dans les titres de page. */
.content-title .fa-solid, .content-title .fa-regular,
.content-title .fa-brands, .content-title .fa-light { display: none !important; }

/* ════════════════════════════════════════════════════════════════════════
   Convention v3.4.3 (2026-05-21) — Cellules de tableau à 2 lignes
   ────────────────────────────────────────────────────────────────────────
   Pour densifier les list_view sans multiplier les colonnes, on combine
   2 informations dans une même cellule :
       <div class="cell-main">Valeur principale</div>
       <div class="cell-sub">Information secondaire (gris discret)</div>

   Usage typique :
   • Désignation client + code bureau en sous-ligne (au lieu d'une colonne Bureau)
   • Montant consommé + plafond en sous-ligne (au lieu d'une colonne Plafond)
   ════════════════════════════════════════════════════════════════════════ */
.cell-main {
	font-size: var(--font-size-base);
	color: var(--text-primary);
	line-height: 1.3;
}
.cell-sub {
	font-size: 11px;
	color: var(--text-secondary);
	line-height: 1.3;
	margin-top: 2px;
	font-weight: 400;
}
.cell-sub:empty { display: none; }
/* Si la cellule est alignée à droite (align: 'right'), les sous-lignes le sont aussi. */
.table td[class*="text-end"] .cell-main,
.table td[class*="text-end"] .cell-sub { text-align: right; }

#report_nav_links,
#report_form_links {
	margin-left: auto;
	display: flex;
	gap: 2px;
}

#report_nav_links + #report_form_links {
	margin-left: 0;
}

#report_nav_links .nav-link-btn,
#report_form_links .form-link-btn {
	background: none;
	border: none;
	color: var(--accent);
	font-size: .8rem;
	font-weight: 500;
	padding: 2px 8px;
	cursor: pointer;
	text-decoration: none;
}

#report_nav_links .nav-link-btn:hover,
#report_form_links .form-link-btn:hover {
	text-decoration: underline;
	color: var(--accent-hover);
}

/* ---- Action icons (tables standards, hors list_view) ---- */
.record_tools .fa-solid,
.record_tools .fa-regular,
.change_password_command,
.update_data,
.cancel_data {
	padding: 4px 6px;
	margin: 0 2px;
	cursor: pointer;
	color: var(--text-secondary);
	transition: color var(--transition);
}

.record_tools .fa-solid:hover,
.record_tools .fa-regular:hover,
.change_password_command:hover,
.update_data:hover,
.cancel_data:hover {
	color: var(--accent);
}

.form-container {
	max-width: 480px;
	margin: 0 auto;
}

.form-actions {
	display: flex;
	gap: 8px;
	justify-content: flex-end;
	margin-bottom: 24px;
}

.report-header {
	text-align: center;
	margin-bottom: 24px;
}

.report-header img {
	width: 180px;
	height: auto;
	margin-bottom: 8px;
}

.report-header .report-subtitle {
	color: var(--accent);
	font-weight: 600;
}

.report-header h3 {
	font-weight: 700;
	margin-top: 16px;
	letter-spacing: 0.02em;
}

.report-header h3 small {
	font-weight: 400;
	color: var(--text-secondary);
}

.report-header .report-date {
	text-align: right;
	color: var(--text-secondary);
}

.report-main-title {
	font-weight: 700;
	margin-top: 16px;
	letter-spacing: 0.02em;
}

.no_display,
input[type="radio"].no_display,
input[type="checkbox"].no_display {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	pointer-events: none;
}

.data_block {
	text-transform: uppercase;
}

.print_change_ticket, #expand_content, .dropdown-menu a {
	cursor: pointer;
}

.number {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.input-group-text {
	padding-left: 20px;
	padding-right: 20px;
}

input[type="number"] {
	text-align: right;
}

/* ════════════════════════════════════════════════
   Empty state — pattern réutilisable
   Usage minimal :
       <div class="empty-state">
           <i class="empty-state-icon fa-regular fa-folder-open"></i>
           <h3 class="empty-state-title">Aucun enregistrement</h3>
           <p class="empty-state-hint">Commencez par ajouter votre premier élément.</p>
           <button class="btn btn-primary btn-sm empty-state-action">
               <i class="fa-solid fa-plus"></i> Nouveau
           </button>
       </div>
   ════════════════════════════════════════════════ */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    color: var(--text-secondary);
    max-width: 420px;
    margin: 0 auto;
}
.empty-state-icon {
    font-size: 40px;
    color: var(--text-secondary);
    opacity: 0.5;
    margin-bottom: 16px;
    display: block;
}
.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}
.empty-state-hint {
    font-size: var(--font-size-base);
    color: var(--text-secondary);
    margin: 0 0 20px;
    line-height: 1.5;
}
.empty-state-action {
    margin-top: 4px;
}

.btn, .btn-sm { border-radius: 7px; font-weight: 500; transition: background .15s, border-color .15s; }
.btn-sm { padding: 6px 12px; font-size: var(--font-size-base); }
.btn-primary { box-shadow: none; }
.btn-outline-primary:hover { box-shadow: none; }

.btn:focus, .form-control:focus, .form-select:focus, .form-check-input:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent) !important;
    border-color: var(--accent) !important;
}

/* ════════════════════════════════════════════════
   Respecte prefers-reduced-motion — a11y
   Les utilisateurs avec vestibular disorders ou en mode économie
   de batterie désactivent les animations système. On respecte.
   ════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.ms-bar {
    display: flex;
    align-items: flex-start;
    gap: 0;
    padding: 20px 0 10px;
    overflow-x: auto;
    position: relative;
}
.ms-node {
    flex: 1 1 0;
    min-width: 140px;
    text-align: center;
    position: relative;
    padding: 0 8px;
}

.ms-node::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 50%;
    right: -50%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.ms-node:last-child::before { display: none; }

.ms-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #00B4D8, #0891b2);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    position: relative;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 180, 216, 0.25);
}
.ms-label {
    font-size: var(--font-size-base);
    font-weight: 500;
    color: #0f172a;
    margin-top: 10px;
    line-height: 1.3;
    letter-spacing: -0.005em;
}
.ms-code {
    display: block;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
}
.ms-desc {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}

.ms-node.ms-done   .ms-circle { background: linear-gradient(135deg, #10B981, #059669); box-shadow: 0 1px 3px rgba(16, 185, 129, 0.25); }
.ms-node.ms-active .ms-circle { background: linear-gradient(135deg, #00B4D8, #0891b2); }
.ms-node.ms-todo   .ms-circle { background: #e2e8f0; color: #64748b; box-shadow: none; }
.ms-node.ms-done::before   { background: #10B981; }

/* ════════════════════════════════════════════════
   Print — règles canoniques iManage
   Cache le chrome UI, neutralise les positions fixes, formate la page A4.
   Les apps peuvent ajouter leurs règles spécifiques dans leur app.css.
   ════════════════════════════════════════════════ */
@media print {
	.navbar,
	#notification_box,
	#page_header,
	#busy_overlay,
	.print_toolbar,
	.form-actions,
	.record_tools,
	.session_controls,
	.no-print {
		display: none !important;
	}

	body {
		background: #fff !important;
		color: #000 !important;
		padding-top: 0 !important;
		font-size: 9pt !important;
	}

	#page, #page_content {
		position: static !important;
		overflow: visible !important;
		padding: 0 !important;
		margin: 0 !important;
		background: #fff !important;
	}

	#requested_content,
	#requested_content > div {
		background: #fff !important;
		padding: 0 !important;
	}

	table { width: 100%; }
	td { vertical-align: top; }
	a { text-decoration: none !important; color: #000 !important; }

	.card-header { padding: 4px 8px !important; }
	.card-body { padding: 0 !important; }
	h5 { font-size: 11pt !important; }

	.report-header { margin-bottom: 16px; }
	.report-header img { width: 140px; }
	.report-main-title { margin-top: 8px; }

	@page { size: A4 landscape; margin: 15mm; }
}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE — exploitation optimale de l'espace horizontal sur tous mobiles
   ════════════════════════════════════════════════════════════════════════ */

/* ─── container-fluid : cap visuel + paddings adaptatifs ─────────────────
   Variable CSS --app-px définit le padding horizontal commun à TOUTES les
   container-fluid de la page (navbar, header, breadcrumb, requested_content)
   pour garantir un alignement parfait entre menu et contenu.
   Bootstrap met par défaut padding-inline 12px sur container-fluid. On
   l'augmente avec la taille de l'écran pour aérer sur grands écrans.
*/
:root {
    --app-px: 12px;
    /* Cap horizontal du contenu — appliqué à navbar, header, breadcrumb et
       requested_content via .container-fluid. 1400px = largeur confortable
       pour tableaux, dashboards et formulaires sans dispersion visuelle sur
       les écrans 4K. Le contenu se centre automatiquement (margin: auto). */
    --app-max-w: 1400px;
}
@media (min-width: 768px)  { :root { --app-px: 20px; } }
@media (min-width: 1200px) { :root { --app-px: 28px; } }
@media (min-width: 1600px) { :root { --app-px: 40px; } }

.container-fluid {
    max-width: var(--app-max-w);
    margin-inline: auto;
    padding-inline: var(--app-px);
}
/* La navbar n'a PAS de padding horizontal — c'est son .container-fluid
   interne qui le porte (alignement parfait avec #requested_content). */
.navbar { padding-inline: 0; }

/* ─── Mobile : navbar plus compact + touch targets ≥ 44px ──────────────── */
@media (max-width: 767.98px) {
    .navbar { padding-block: 8px; padding-inline: 0; }
    .navbar-toggler { padding: 8px 10px; min-width: 44px; min-height: 44px; }
    /* Le user account devient un avatar circulaire seul sur mobile pour
       économiser l'espace — le nom complet et le rôle vont dans le panneau
       qui s'ouvre au clic. */
    @media (max-width: 575.98px) {
        #user .ua-name,
        #user .ua-job,
        #user .ua-clinic { display: none !important; }
        #user .ua-avatar-wrap { margin: 0; }
    }
}

/* ─── Mobile : footer compact, items wrappent proprement ───────────────── */
@media (max-width: 575.98px) {
    #page_footer { padding: 0 8px; height: auto; min-height: 48px; }
    #page_footer .footer-row {
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 12px;
        padding: 6px 0;
    }
    #page_footer .footer-brand,
    #page_footer .footer-datetime { flex: 1 1 auto; justify-content: center; }
    body:has(#page_footer) { padding-bottom: 68px; }  /* hauteur réelle augmentée */
}

/* ─── Modal Bootstrap : plein écran sous 576px (login, change-password) ── */
@media (max-width: 575.98px) {
    .modal-dialog:not(.modal-fullscreen) {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
    }
    .modal-dialog:not(.modal-fullscreen) .modal-content {
        border-radius: 0;
        min-height: 100vh;
    }
}

/* ─── Tables responsives — scroll horizontal sur mobile au lieu d'écraser
   Les tableaux Bootstrap (.table) qui ne sont pas dans un wrapper responsive
   obtiennent un scroll horizontal natif sur petits écrans. */
@media (max-width: 767.98px) {
    table.table:not(.table-borderless):not(.table-ticket) {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ─── Form panels (record-detail, form-container) : fullscreen mobile ── */
@media (max-width: 575.98px) {
    .form-panel,
    .form-panel.form-panel-xl,
    .form-panel.form-panel-xxl {
        max-width: 100% !important;
        width: 100% !important;
        height: 100vh !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
    }
    .record-detail {
        max-width: 100% !important;
        width: 100% !important;
        border-radius: 0 !important;
    }
}

/* ─── Dashboard sur tablette : KPIs en 2 colonnes au lieu de 1 large ───
   Le grid auto-fit minmax(200px, 1fr) défini dans .g-kpis gère déjà la
   plupart des cas. On force juste un comportement clean entre 576-900px. */
@media (min-width: 576px) and (max-width: 899.98px) {
    .dashboard-v3 .g-kpis {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── Tile-view : déjà responsive via tile-view.css (1 col mobile,
   2 cols tablette, 3-4 cols desktop). Rien à ajouter ici. */

/* ─── List-view : table compactée sur mobile ─────────────────────────── */
@media (max-width: 575.98px) {
    .lv-actions { flex-wrap: wrap; gap: 8px; }
    .lv-search { flex: 1 1 100%; }
    .lv-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        text-align: center;
    }
    .lv-pager { justify-content: center; }
}

/* ─── Inputs : taille touch confortable sur mobile (≥ 16px évite zoom iOS) */
@media (max-width: 767.98px) {
    .form-control,
    .form-select,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    input[type="tel"],
    input[type="number"],
    input[type="date"],
    input[type="time"],
    textarea,
    select {
        font-size: 16px;     /* évite le zoom auto sur iOS Safari */
    }
    .btn {
        min-height: 40px;    /* touch target accessibilité */
    }
}


/* ─── Accessibilité — respect du prefers-reduced-motion ──────────────
   Désactive toutes les animations/transitions pour les utilisateurs qui
   l'ont configuré dans leur OS (WCAG 2.1 — 2.3.3 Animation from Interactions).
   À appliquer globalement plutôt que dans chaque composant. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
