/* refresh.css : rafraichissement visuel commun a EquansMCO et EquansMag (v1)
   Charge APRES main.css. Memes couleurs et memes structures ; seuls les details changent.
   Retour arriere : retirer la ligne <link ... refresh.css> de base.html (ou restaurer la sauvegarde). */

@font-face {
  font-family: 'EQ Sans';
  src: url('/static/css/dmsans-latin.woff2') format('woff2');
  font-weight: 100 1000; font-style: normal; font-display: swap;
}

:root {
  --font: 'EQ Sans', 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --ring: 0 0 0 3px rgba(45,122,94,.22);
  --shadow: 0 1px 2px rgba(26,61,46,.06), 0 6px 18px -6px rgba(26,61,46,.10);
  --shadow-lg: 0 2px 4px rgba(26,61,46,.06), 0 14px 30px -10px rgba(26,61,46,.20);
  --line: #dbe8e1;
}

/* ===== Base : une seule police, rendu net, chiffres alignes ===== */
body { font-family: var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; line-height: 1.55; }
button, input, select, textarea { font-family: inherit; }
::selection { background: #bfe3d3; color: var(--primary-dark); }
.table, .stat-value, .badge, .sidebar-badge, td, th, code { font-variant-numeric: tabular-nums; }
h1, h2, h3 { text-wrap: balance; }

/* ===== Focus clavier visible et homogene ===== */
a:focus-visible, button:focus-visible, [role=button]:focus-visible, summary:focus-visible,
.nav-link:focus-visible, .sidebar-item:focus-visible, .btn:focus-visible {
  outline: 2px solid var(--primary-light); outline-offset: 2px; border-radius: 8px;
}
.navbar a:focus-visible, .navbar button:focus-visible { outline-color: #fff; }

/* ===== Barre de navigation ===== */
.navbar { border-bottom: 1px solid rgba(106,184,154,.45); box-shadow: 0 1px 0 rgba(0,0,0,.18), 0 8px 24px -12px rgba(0,0,0,.45); }
.nav-app-name { letter-spacing: -.01em; }
.nav-link { font-weight: 500; transition: background .15s, color .15s, box-shadow .15s; }
.nav-link.active, .nav-link.nav-active, .nav-link[aria-current] { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 0 -2px 0 var(--accent); }

/* ===== Menu lateral (EquansMCO) ===== */
.sidebar-item { transition: background .15s, color .15s; }
.sidebar-item.active { font-weight: 600; }

/* barre de menu plus compacte sur les ecrans moyens (portables, tablettes) : tout reste visible */
@media (min-width: 769px) and (max-width: 1280px) {
  .navbar { padding: 0 14px; gap: 4px; }
  .nav-brand { margin-right: 10px; }
  .nav-app-sub { display: none; }
  .nav-links { gap: 2px; }
  .nav-link { padding: 7px 9px; gap: 0; }
  .nav-link svg { display: none; }
  .nav-user { gap: 8px; }
}

/* ===== Titres de page ===== */
.page-title { letter-spacing: -.02em; line-height: 1.2; }
.page-subtitle { margin-top: 4px; }

/* ===== Cartes de chiffres : lisibles, sans majuscules forcees ===== */
.stat-card { border-radius: 12px; box-shadow: var(--shadow); transition: transform .18s ease, box-shadow .18s ease; }
.stat-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.stat-value { font-family: var(--font); font-weight: 700; letter-spacing: -.03em; }
.stat-label { text-transform: none; letter-spacing: 0; font-weight: 500; margin-top: 8px; }

/* ===== Cartes ===== */
.card { box-shadow: var(--shadow); border: 1px solid rgba(213,229,222,.55); border-radius: 12px; }

/* ===== Tableaux ===== */
.table-wrapper { border-color: var(--line); border-radius: 10px; }
.table thead th { text-transform: none; letter-spacing: .01em; font-weight: 600; }
@media (min-width: 769px) {
  .stat-value { font-size: 38px; }
  .stat-label { font-size: 13px; }
  .table thead th { font-size: 12.5px; padding: 12px 14px; }
  .table td { padding: 11px 14px; }
  .badge { padding: 3px 10px; }
}
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: #f1f8f5; }
.table tbody tr { border-bottom-color: #e6efea; }

/* ===== Pastilles ===== */
.badge { font-weight: 600; letter-spacing: .01em; }

/* ===== Boutons ===== */
.btn { font-family: inherit; font-weight: 600; letter-spacing: .005em; transition: background .15s, color .15s, box-shadow .15s, transform .08s, border-color .15s; }
.btn-primary { box-shadow: 0 1px 2px rgba(26,61,46,.25); }
.btn-primary:hover, .btn-success:hover, .btn-danger:hover, .btn-info:hover { box-shadow: 0 3px 10px -3px rgba(26,61,46,.35); }
.btn-secondary { border: 1px solid #d3e3db; }
.btn-outline { border-width: 1.5px; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled, .btn[disabled], .btn.disabled { opacity: .55; cursor: not-allowed; box-shadow: none; transform: none; }

/* ===== Champs ===== */
.form-group input, .form-group select, .form-group textarea { font-family: inherit; }
.form-group label, .form-label { text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 600; color: var(--text); }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password], input[type=tel],
input[type=search], input[type=url], input[type=time], input[type=datetime-local], select, textarea,
input.form-input, select.form-input, textarea.form-input {
  border-radius: 8px; border-color: #c9ddd3; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:hover:not(:disabled):not([type=checkbox]):not([type=radio]), select:hover:not(:disabled), textarea:hover:not(:disabled) { border-color: #a9cbbb; }
input:focus:not([type=checkbox]):not([type=radio]), select:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: var(--ring);
}
input:disabled, select:disabled, textarea:disabled { background: #f3f7f5; color: var(--text-secondary); cursor: not-allowed; }
::placeholder { color: #8aa398; opacity: 1; }
input[type=checkbox], input[type=radio] { accent-color: var(--primary); }

/* ===== Etats vides et messages ===== */
.empty-state, .empty { color: var(--text-secondary); }

/* ===== Barres de defilement discretes ===== */
* { scrollbar-width: thin; scrollbar-color: #b7d0c5 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #b7d0c5; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #93b8a7; background-clip: content-box; border: 2px solid transparent; }

/* ===== Respect de la preference "moins d'animations" ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .stat-card:hover, .btn:active { transform: none; }
}
