/* FOBAK V129.6.21.4 — audit général de lisibilité, contraste et stabilité visuelle. */
:root{
  --fobak-readable-ink:#152b3d;
  --fobak-readable-muted:#526579;
  --fobak-readable-border:#aebfce;
  --fobak-on-primary:#ffffff;
  --fobak-on-secondary:#071d33;
  --fobak-on-accent:#172033;
  --fobak-on-danger:#ffffff;
  --fobak-on-success:#ffffff;
  --fobak-on-header:#ffffff;
  --fobak-on-sidebar:#ffffff;
  --fobak-on-footer:#ffffff;
}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%;scroll-behavior:smooth}
body{line-height:1.48}

/* Lisibilité générale : les textes secondaires ne doivent jamais devenir gris trop pâle. */
body:not(.receipt-body):not(.print-page) .muted,
body:not(.receipt-body):not(.print-page) .help-text,
body:not(.receipt-body):not(.print-page) .form-help,
body:not(.receipt-body):not(.print-page) .field-help,
body:not(.receipt-body):not(.print-page) .hint,
body:not(.receipt-body):not(.print-page) .helper,
body:not(.receipt-body):not(.print-page) .panel-note,
body:not(.receipt-body):not(.print-page) .pp-muted{color:var(--fobak-readable-muted)!important;opacity:1!important}

/* Formulaires : texte, placeholder, bordure et focus visibles sur téléphone et ordinateur. */
body:not(.receipt-body) input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
body:not(.receipt-body) select,
body:not(.receipt-body) textarea{
  color:var(--fobak-readable-ink);
  border-color:var(--fobak-readable-border);
  background-color:#fff;
}
body:not(.receipt-body) input::placeholder,
body:not(.receipt-body) textarea::placeholder{color:#526579!important;opacity:1!important}
body:not(.receipt-body) input:disabled,
body:not(.receipt-body) select:disabled,
body:not(.receipt-body) textarea:disabled{color:#41566a!important;background:#edf2f6!important;opacity:1!important;cursor:not-allowed}
.form label,.filters label,.field label,.form-grid label,.health-module label{color:#18364e!important;font-weight:800}
body:not(.receipt-body) input:focus-visible,
body:not(.receipt-body) select:focus-visible,
body:not(.receipt-body) textarea:focus-visible,
body:not(.receipt-body) button:focus-visible,
body:not(.receipt-body) a:focus-visible{outline:3px solid rgba(24,157,214,.38)!important;outline-offset:2px}

/* Les messages de validation / alertes restent lisibles et ne sont pas cachés sous l'en-tête fixe. */
body.admin-layout input,body.admin-layout select,body.admin-layout textarea,
body.admin-layout [id],body.health-admin [id]{scroll-margin-top:calc(var(--fobak-topbar-height,120px) + 26px)}
.flash,.health-alert,.pp-notice{font-size:14px;line-height:1.5;font-weight:650}
.flash.warning{color:#604600!important}.flash.danger{color:#8f1720!important}.flash.success{color:#075d37!important}

/* Boutons et liens d'action : minimum visuel cohérent. */
.btn,.health-btn{line-height:1.25}
.btn.small{font-size:13px!important;min-height:36px}
.btn.primary{color:var(--fobak-on-accent)!important}
.tabs a.active,.global-search-form button,.admin-shortcut.primary{color:var(--fobak-on-primary)!important}
.kpi-icon.blue{color:var(--fobak-on-primary)!important}
.kpi-icon.yellow{color:var(--fobak-on-accent)!important}
.kpi-icon.red{color:var(--fobak-on-danger)!important}
.kpi-icon.green{color:var(--fobak-on-success)!important}

/* Tableaux : évite le gris trop léger et garde une lecture claire en défilement horizontal. */
.table-wrap,.pp-table{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
table{color:#20384c}
th{color:#0b4f86!important;font-weight:850}
td{line-height:1.42}
.table-wrap table tbody tr:hover{background:#f6fbff}

/* En-têtes et menus : contraste garanti même après personnalisation. */
.site-header.public-header,.public-header{color:var(--fobak-on-header)!important}
.site-header.public-header a,.public-header a,.site-header.public-header strong,.public-header strong{color:inherit}
.side-dashboard,.health-sidebar{color:var(--fobak-on-sidebar)!important}
.app-footer.dashboard-style-footer,.fobak-unified-footer{color:var(--fobak-on-footer)!important}
body.admin-layout .workspace-welcome small{opacity:1!important;color:#f0f7fc!important}
body.admin-layout .global-search-form input::placeholder{color:#526579!important;opacity:1!important}

/* Les actions masquées au survol restent disponibles sur écran tactile. */
@media (hover:none),(pointer:coarse){.message-actions,.activity-actions,.row-actions{opacity:1!important;visibility:visible!important}}

/* Texte des zones administratives : aucun libellé important sous 13 px à l'écran. */
@media screen{
  .side-menu a,.side-menu summary,.health-nav a,.health-nav summary{font-size:max(14px,.9rem)}
  .side-menu-search-empty,.health-menu-search-empty,.appearance-color-field small,.submenu-copy small{font-size:12.5px!important;line-height:1.4}
  .print-footer-note{font-size:11px}
}

/* Téléphone : police confortable, champs à 16 px (évite aussi le zoom automatique iOS), contenu non masqué. */
@media screen and (max-width:780px){
  body.admin-layout .workspace-content{scroll-padding-top:calc(var(--fobak-topbar-height,220px) + 18px)}
  body.admin-layout .workspace-welcome strong{font-size:clamp(17px,4.9vw,21px)!important;line-height:1.25!important}
  body.admin-layout .workspace-welcome small{font-size:13px!important;line-height:1.4!important}
  body.admin-layout input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
  body.admin-layout select,body.admin-layout textarea,
  body.health-admin input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="range"]),
  body.health-admin select,body.health-admin textarea{font-size:16px!important;min-height:46px}
  .form label,.filters label,.form-grid label{font-size:14px!important;line-height:1.35}
  .card,.panel-card,.module-group,.appearance-section{overflow-wrap:anywhere}
  .table-wrap table,.pp-table table{font-size:13px}
  .table-wrap th,.table-wrap td,.pp-table th,.pp-table td{padding:10px 9px}
  .top-actions sup,.health-top-actions sup{font-size:11px!important;min-width:20px;min-height:20px;display:grid;place-items:center}
  .public-language-menu>summary>strong,.language-menu-options>a>span,.public-nav-professional .public-nav-caret{font-size:12px!important}
  .public-nav-professional .submenu-copy small{font-size:12.5px!important}
  .footer-app-icon small,.public-mobile-brand small{font-size:11px!important}
}

/* Très petits écrans : les zones d'actions passent à la ligne au lieu de couper le texte. */
@media screen and (max-width:420px){
  .actions-cell,.receipt-actions{min-width:0!important;white-space:normal!important}
  .admin-menu,.appearance-toolbar,.links-row{gap:8px}
  .btn{white-space:normal;text-align:center}
}

/* Portail patient / santé : correction de contrastes secondaires. */
.patient-portal .pp-muted,.patient-portal .pp-empty,.patient-portal .pp-footer-note{color:#526579!important}
.health-public small,.health-public .health-section-heading p{opacity:1}


/* Libellés très petits repérés pendant l'audit : relèvement ciblé sans grossir les reçus. */
@media screen and (max-width:780px){
  .site-header.public-header .brand-block span,.site-header.public-header .brand-block em{font-size:11.5px!important;line-height:1.3!important;opacity:.96!important}
  .fobak-social-icons .social-whatsapp small{font-size:10px!important;line-height:1.05!important}
  .fobak-logout-steps span,.fobak-logout-steps span b{font-size:11px!important}
  .communique-ticker.enhanced-ticker>strong{font-size:11px!important}
  .public-language-wrap>span{font-size:12px!important}
  .app-footer .footer-bottom{font-size:12px!important;line-height:1.4!important}
}
.health-alert-item small,.health-activity-list small,.health-activity-list time{color:#526579!important;opacity:1!important}

@media print{
  /* Ne pas dégrader les documents imprimés avec les règles d'écran. */
  body{line-height:normal}
  .print-footer-note{font-size:11px!important;color:#354f63!important}
}
