/* CALIGEST UI — échelle typographique commune.
   Charger en dernier. Une seule famille, six tailles, trois graisses :
   500 pour lire, 600 pour repérer, 700 pour titrer. Pas de texte de contenu sous 12 px. */
:root {
  --ui-fs-xs: 12px;      /* badges, compteurs, légendes, pieds de tableau */
  --ui-fs-sm: 13px;      /* libellés, en-têtes de colonnes, aides et notes */
  --ui-fs-base: 14px;    /* texte courant, cellules, champs, boutons, menus */
  --ui-fs-h3: 16px;      /* en-têtes de panneau et de carte */
  --ui-fs-h2: 20px;      /* titres de dialogue et de volet */
  --ui-fs-h1: 24px;      /* titre de page */
  --ui-fs-display: 30px; /* chiffres clés du tableau de bord */
  --ui-lh: 1.45;
  --ui-lh-tight: 1.2;
}

/* Texte courant : taille de base et couleur foncée partout. */
body,
.cg-table,
.cart-table,
.dropdown-menu,
.ctx-menu,
.dashboard-current,
.dashboard-files,
.dashboard-block-choice,
.modal .theme-choice,
.modal .family-settings-table,
.sheet-attachment__links { font-size: var(--ui-fs-base); line-height: var(--ui-lh); }
body { color: var(--cg-text); font-weight: 500; }
.form-control, .form-select, .dropdown-item, ::placeholder, .btn { font-weight: 500; }
.cg-table tbody td, .cart-table td, .dash-alerts__table td, .dash-alerts__table td a, .side-row__name, .side-resources a, .side-resources button, .sheet-attachments h3 span, code, kbd { font-weight: 500; }
.report-indicator sup { font-size: 11px; min-width: 14px; line-height: 14px; right: -8px; top: -6px; }
code, kbd { font-size: var(--ui-fs-xs); }

/* Cellules, champs, boutons, menus et listes : une seule taille de lecture. */
.cg-table tbody td,
.cart-table td,
.dashboard-history .dash-alerts__table,
.dashboard-history .dash-alerts__table td,
.form-control, .form-select,
.field :is(.form-control, .form-select),
.modal :is(.form-control, .form-select),
.preferences-grid .form-control, .preferences-grid .form-select,
.modal .family-settings-table .family-name-input,
.modal .family-settings-child .family-name-input,
.family-settings-table .form-control,
.filters-bar__search .form-control,
.filters-bar__select,
.multi-search .form-control,
.form-check-label,
.permission-field .form-select,
.dropdown-item, .app-header .dropdown-item,
.app-header .app-nav__menu.cg-menu .dropdown-item,
.ctx-menu__item,
.sp-row,
.sector-picker__btn,
.field__static,
.dash-list li,
.dashboard-parc__details .dash-list li,
.dashboard-retards .dash-list li,
.dashboard-grid .dash-list li,
.dashboard-grid .dash-stat__label,
.dashboard-grid .dash-quick__item,
.dash-quick__item, .dashboard-workflow__list a,
.dash-card__foot,
.dash-alerts__all,
.dash-note,
.dashboard-ce__message,
.dashboard-dialog__note,
.dashboard-planning__summary,
.cart-item__instrument > a,
.cert,
.cart-selection,
.cart-blank p,
.cg-table__empty td,
.link-state,
.logout-link,
.bulk-actions strong,
.instrument-status-tooltip .tooltip-inner,
.app-header .app-nav__list > li > a,
.app-sidebar .side-all,
.side-row__name { font-size: var(--ui-fs-base); }

.btn, .modal .btn, .page-actions .btn, .users-foot .btn-tool, .btn-split .btn, .btn-tool, .btn-view, .filters-bar__add {
  font-size: var(--ui-fs-base); font-weight: 600;
}
.btn.btn-sm, .modal .btn.btn-sm, .cart-bulk .btn, .bulk-actions button { font-size: var(--ui-fs-sm); font-weight: 600; }

/* Graisses de lecture : le texte courant est en 500 (Barlow Medium), le repère en 600. */
.form-control, .form-select, .dropdown-item, .ctx-menu__item, .sp-row, .pg, .dash-card__foot,
.modal .family-settings-parent .family-name-input, .cart-date, .family-count-badge, .sheet-attachment__name,
.dash-quick__item, .dashboard-workflow__list a, .th-sub { font-weight: 500; }
.pg.is-active, .sp-row.is-selected, .sector-picker__path .leaf, .code, .user-cell__id, .dashboard-bars__value,
.instrument-link, .cart-certificate, .cert, .breadcrumb-cg a, .logout-link, .link-state, .cart-selection,
.dash-alerts__all, .dash-alerts__table .col-msg, .col-etal, .field__ok, .field__state, .dash-list__value,
.dash-note__link, .cart-item__instrument > a, .active-filter, .sector-picker__hint strong, .dash-gauge__head strong,
.cart-table td[data-label]::before, .dashboard-toolbar__mode, .dashboard-edit-done, .sheet-attachment__name,
.badge-cg, .cart-size, .tag, .avatar { font-weight: 600; }
.code, .page-title, .brand__title { letter-spacing: 0; }

/* Libellés, en-têtes de colonnes et kickers : un seul style de repère. */
.form-label, .field__label, .modal .form-label, .modal .preferences-grid label, .preferences-grid label,
.permission-field, .period-box__label,
.cg-table thead th, .cart-table thead th, .cg-table__head th, .modal .family-settings-table th,
.dash-stat__over, .dash-stat__label, .dash-gauge__head, .cart-select-all,
.dashboard-summary__head span {
  font-size: var(--ui-fs-sm); font-weight: 600; color: var(--ui-text); letter-spacing: 0; text-transform: none;
}
.dash-card__title, .dashboard-card__head .dash-card__title, .dashboard-grid .dash-card__title, .dash-alerts .dash-card__title,
.cg-modal-kicker, .modal .family-settings-table th, .ctx-menu__head::before, .ctx-menu__head > span,
.app-header .app-nav__menu.cg-menu .cg-menu-section {
  font-size: var(--ui-fs-xs); font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
}
.dash-card__title { color: var(--ui-text); }

/* Texte secondaire : une taille, une couleur, pas de demi-tailles. */
.page-count, .dash-hello .page-count, .page-head__id .page-count, .toolbar__label, .sheet-summary,
.sheet-field-hint, .form-text, .preference-note, .modal .preference-note, .sector-picker__hint,
.breadcrumb-cg, .cart-meta, .cart-overdue, .cart-validation, .dashboard-workflow__list a span,
.alert, .app-notice, .cg-tooltip, .card-footer, .table-help, .dashboard-toolbar__note,
.form-control-sm, .form-select-sm, .cg-table .form-select-sm, .column-filter .column-filter-input,
.column-filter select, .column-filter-input, .fbox input, .table-foot__perpage .form-select,
.period-box .form-select, .sheet-attachment-add, .dashboard-toolbar__mode, .dashboard-edit-done,
.family-order-controls .family-order-button, .tag { font-size: var(--ui-fs-sm); }

.badge-cg, .cart-size, .table-foot__info, .table-foot__perpage, .certificate-date, .th-sub,
.dashboard-summary__scale, .dashboard-summary__legend, .dashboard-chart__label, .dashboard-chart figcaption,
.dashboard-planning__note, .dashboard-bars__label, .dashboard-certificates .certificate-name,
.cg-dialog-footer-note, .family-count-badge, .cart-footer > span, .dash-gauge__scale, .dash-quick__go,
.sheet-attachments h3 span, .sheet-attachment__download, .invalid-feedback, .sp-row__count, .dash-list__pct,
.dashboard-parc__details .dash-list__pct, .avatar, .cart-deselect, .active-filter,
.app-sidebar .side-all__count, .app-sidebar .side-row__count, .app-sidebar .side-listhead__label,
.dash-alerts__all i { font-size: var(--ui-fs-xs); }
.dashboard-summary__scale, .dashboard-summary__legend, .dashboard-chart__label { line-height: var(--ui-lh); }

/* Titres : trois niveaux, une graisse. */
.page-title, .dashboard-main .page-title { font-size: var(--ui-fs-h1); font-weight: 700; line-height: var(--ui-lh-tight); }
.modal .modal-title, .offcanvas:not(.app-nav):not(.app-sidebar) .offcanvas-title, .cart-heading h2, .cart-blank h3 {
  font-size: var(--ui-fs-h2); font-weight: 700; line-height: var(--ui-lh-tight);
}
.form-panel .form-panel__head, .form-panel__head, .card-header, .modal .preference-section h3, .preference-section h3,
.sheet-attachments h3, .dashboard-summary__head span {
  font-size: var(--ui-fs-h3); font-weight: 600; line-height: var(--ui-lh-tight);
}
.dashboard-summary__head span { font-size: var(--ui-fs-sm); }

/* Liens, petits textes et compteurs : mêmes tokens que le reste. */
a { color: var(--cg-link); }
a:hover { color: var(--ui-primary-hover); }
small, .small { font-size: var(--ui-fs-xs); }
.text-secondary, .text-muted, .text-body-secondary { color: var(--ui-muted) !important; }
.cart-count, .app-sidebar .side-seg__badge, .side-seg__badge, .app-sidebar .side-listhead__meta, .side-listhead__meta { font-size: var(--ui-fs-xs); }
.cart-count { min-width: 20px; line-height: 1.2; }

/* Chiffres clés : une seule famille de nombres. */
.dash-stat__value, .dashboard-grid .dash-stat__value, .dashboard-summary__head strong, .dashboard-current strong {
  font-size: var(--ui-fs-display); font-weight: 700; letter-spacing: 0; line-height: 1;
}
.dashboard-planning__summary strong, .dashboard-chart__total { font-size: var(--ui-fs-h1); font-weight: 700; }

@media (max-width: 767.98px) {
  .page-title, .dashboard-main .page-title { font-size: var(--ui-fs-h2); }
  .modal .modal-title, .cart-heading h2 { font-size: var(--ui-fs-h3); }
  .dash-stat__value, .dashboard-grid .dash-stat__value, .dashboard-summary__head strong, .dashboard-current strong { font-size: var(--ui-fs-h1); }
}
