/* =============================================================================
 * styles.css — Thème clair, sobre, crédible, orienté dashboard (desktop-first)
 * ========================================================================== */
:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --border: #e7e9ee;
  --border-strong: #d5d9e0;
  --text: #1c2230;
  --text-2: #5a6474;
  --text-3: #8a93a3;
  --accent: #2f9e8f;
  --accent-soft: #e6f3f1;
  --info: #3b9bd6;
  --warn: #e08a4c;
  --danger: #d9534f;
  --success: #2f9e8f;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(20, 28, 45, 0.04), 0 4px 16px rgba(20, 28, 45, 0.05);
  --shadow-sm: 0 1px 2px rgba(20, 28, 45, 0.06);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
button { font-family: inherit; cursor: pointer; }
.icon { display: block; }
.muted { color: var(--text-2); }
.small { font-size: 12.5px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------------
 * Écran choix de profil
 * ------------------------------------------------------------------------ */
.profiles-screen {
  max-width: 920px;
  margin: 0 auto;
  padding: 7vh 24px 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.profiles-screen.narrow { max-width: 720px; }
.brand-lockup { text-align: center; margin-bottom: 40px; }
.brand-mark {
  width: 62px; height: 62px; margin: 0 auto 16px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #257e72);
  color: #fff; font-size: 34px; font-weight: 700;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(47, 158, 143, 0.3);
}
.brand-mark.sm { width: 34px; height: 34px; font-size: 20px; border-radius: 10px; box-shadow: none; }
.brand-name { font-size: 30px; }
.brand-name.sm { font-size: 18px; }
.brand-tag { color: var(--text-2); margin-top: 6px; }

.profiles-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s;
}
.profile-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(20, 28, 45, 0.1);
  border-color: var(--border-strong);
}
.profile-card > * { pointer-events: none; }
.profile-avatar {
  width: 54px; height: 54px; border-radius: 14px;
  display: grid; place-items: center;
  color: #fff; font-size: 24px; font-weight: 600;
}
.profile-avatar.sm { width: 38px; height: 38px; font-size: 17px; border-radius: 11px; }
.profile-info h2 { font-size: 20px; }
.profile-meta { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.profile-stats { display: flex; gap: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.profile-stat { display: flex; flex-direction: column; gap: 2px; }
.ps-value { font-size: 17px; font-weight: 600; }
.ps-label { font-size: 11.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.03em; }
.rank-chip { font-weight: 700; }
.profile-add {
  align-items: center; justify-content: center;
  border-style: dashed; color: var(--text-2); background: var(--surface-2);
  min-height: 180px;
}
.profile-add-icon { color: var(--accent); }
.profile-add span { pointer-events: none; font-weight: 500; }
.link-reset {
  margin-top: 34px; background: none; border: none; color: var(--text-3);
  font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px;
}
.link-reset:hover { color: var(--text-2); }

/* ---------------------------------------------------------------------------
 * Layout appli (sidebar + contenu)
 * ------------------------------------------------------------------------ */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 20px 16px;
  display: flex; flex-direction: column; gap: 8px;
  position: sticky; top: 0; height: 100vh;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.profile-switch {
  display: flex; align-items: center; gap: 11px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 9px 11px; margin-bottom: 10px;
  text-align: left;
}
.profile-switch:hover { border-color: var(--border-strong); }
.ps-text { display: flex; flex-direction: column; line-height: 1.25; }
.ps-name { font-weight: 600; font-size: 14px; }
.ps-switch { font-size: 11px; color: var(--text-3); }
.nav { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: none; border: none; color: var(--text-2);
  font-size: 14px; font-weight: 500; text-align: left; width: 100%;
  transition: background 0.12s, color 0.12s;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.logout { margin-top: auto; color: var(--text-3); }
.nav-item.logout:hover { color: var(--danger); }

.content { padding: 32px 40px 60px; max-width: 1240px; width: 100%; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.page-title { font-size: 25px; }
.page-sub { color: var(--text-2); margin-top: 5px; max-width: 640px; }

/* ---------------------------------------------------------------------------
 * Cartes génériques
 * ------------------------------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}
.card-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px 0; }
.card-title { font-size: 15px; font-weight: 600; }
.card-body { padding: 18px 20px 20px; }
.chart-card .card-body { padding: 14px 12px 8px; }

/* ---------------------------------------------------------------------------
 * KPI grid
 * ------------------------------------------------------------------------ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 8px; min-height: 104px;
}
.kpi-top { display: flex; align-items: center; gap: 7px; color: var(--text-3); }
.kpi-icon { display: flex; }
.kpi-label { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-2); }
.kpi-value-row { display: flex; align-items: baseline; gap: 4px; }
.kpi-value { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.kpi-unit { font-size: 13px; color: var(--text-2); font-weight: 500; }
.kpi-sub { font-size: 12px; color: var(--text-3); margin-top: auto; }
.kpi-delta { font-size: 12px; font-weight: 600; margin-top: auto; }
.kpi-delta.down { color: var(--success); }
.kpi-delta.up { color: var(--danger); }
.kpi-delta.flat { color: var(--text-3); }
.kpi-spark { margin-top: 2px; }
.sparkline { width: 100%; height: 30px; }

/* ---------------------------------------------------------------------------
 * Recommandation
 * ------------------------------------------------------------------------ */
.reco {
  display: flex; gap: 16px; padding: 18px 20px;
  border-radius: var(--radius); margin-bottom: 20px;
  border: 1px solid var(--border); background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.reco-icon {
  width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px;
  display: grid; place-items: center; color: #fff;
}
.reco-success .reco-icon { background: var(--success); }
.reco-info .reco-icon { background: var(--info); }
.reco-warn .reco-icon { background: var(--warn); }
.reco-danger .reco-icon { background: var(--danger); }
.reco-neutral .reco-icon { background: var(--text-3); }
.reco-success { border-left: 3px solid var(--success); }
.reco-info { border-left: 3px solid var(--info); }
.reco-warn { border-left: 3px solid var(--warn); }
.reco-danger { border-left: 3px solid var(--danger); }
.reco-body { flex: 1; }
.reco-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; flex-wrap: wrap; }
.reco-title { font-size: 16px; }
.reco-tag { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 600; }
.reco-msg { color: var(--text-2); margin: 0 0 10px; max-width: 780px; }
.reco-actions { margin: 0 0 10px; padding-left: 18px; color: var(--text); }
.reco-actions li { margin-bottom: 3px; }
.reco-why { font-size: 12px; color: var(--text-3); margin: 0; font-style: italic; }

/* ---------------------------------------------------------------------------
 * Deux colonnes / score
 * ------------------------------------------------------------------------ */
.dash-2col { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; align-items: start; }
.score-card .card-body { padding: 20px; }
.score-layout { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.score-donut { flex-shrink: 0; }
.donut-value { font-size: 30px; font-weight: 700; fill: var(--text); }
.donut-label { font-size: 12px; fill: var(--text-3); }
.score-meta { display: flex; flex-direction: column; gap: 12px; }
.rank-badge {
  width: 52px; height: 52px; border-radius: 13px; color: #fff;
  display: grid; place-items: center;
}
.rank-letter { font-size: 26px; font-weight: 700; }
.score-rank-label { font-weight: 600; font-size: 15px; }
.score-streak { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.score-bars { display: flex; flex-direction: column; gap: 11px; }
.score-bar-row { display: flex; flex-direction: column; gap: 5px; }
.sb-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.sb-label { font-weight: 500; }
.sb-weight { color: var(--text-3); font-size: 11px; }
.sb-value { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }

.progress { height: 7px; background: var(--border); border-radius: 5px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 5px; transition: width 0.4s ease; }

/* ---------------------------------------------------------------------------
 * Graphiques
 * ------------------------------------------------------------------------ */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--border); stroke-width: 1; }
.chart-axis { fill: var(--text-3); font-size: 11px; }
.chart-target { stroke: var(--warn); stroke-width: 1.4; stroke-dasharray: 4 4; }
.chart-target-label { fill: var(--warn); font-size: 11px; font-weight: 600; }
.chart-dot { opacity: 0.5; }
.chart-empty { fill: var(--text-3); font-size: 14px; }
.donut { display: block; margin: 0 auto; }

/* ---------------------------------------------------------------------------
 * Formulaires
 * ------------------------------------------------------------------------ */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }
.form-grid + .form-grid { margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field-hint, .form-hint { font-size: 12px; color: var(--text-3); }
.form-hint { margin: 12px 0 0; }
.input {
  width: 100%; padding: 9px 11px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 14px; font-family: inherit;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { resize: vertical; min-height: 62px; }
select.input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235a6474' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 30px; }

.toggle-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0; }
.toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-track { position: absolute; inset: 0; background: var(--border-strong); border-radius: 20px; transition: 0.2s; }
.toggle-track::before { content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: var(--shadow-sm); }
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle input:checked + .toggle-track::before { transform: translateX(20px); }

.scale { display: flex; gap: 7px; }
.scale-dot {
  width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-weight: 600; font-size: 14px; transition: 0.12s;
}
.scale-dot:hover { border-color: var(--accent); }
.scale-dot.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.add-form, .settings-form { display: block; }
.form-actions { display: flex; gap: 10px; margin-top: 4px; }

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 14px; font-weight: 600;
  transition: 0.14s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #278477; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

/* ---------------------------------------------------------------------------
 * Tables
 * ------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; margin: -4px -4px 0; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 600; color: var(--text-3); font-size: 11.5px;
  text-transform: uppercase; letter-spacing: 0.03em;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
}
.table td { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.table tbody tr:hover { background: var(--surface-2); }
.table td.muted { color: var(--text-3); }
.chip { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11.5px; font-weight: 600; background: var(--border); color: var(--text-3); }
.chip-ok { background: var(--accent-soft); color: var(--accent); }

/* ---------------------------------------------------------------------------
 * Analyse
 * ------------------------------------------------------------------------ */
.status-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px; border-radius: var(--radius); margin-bottom: 18px;
  font-weight: 500; font-size: 14px;
}
.status-success { background: var(--accent-soft); color: #1f6f64; }
.status-warn { background: #fbeee2; color: #a25a1f; }
.status-neutral { background: var(--surface); border: 1px solid var(--border); color: var(--text-2); }
.status-icon { display: flex; }
.analysis-tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.analysis-tile {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 15px 16px;
  display: flex; flex-direction: column; gap: 3px; box-shadow: var(--shadow-sm);
}
.at-label { font-size: 12px; color: var(--text-3); }
.at-value { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.at-sub { font-size: 11.5px; color: var(--text-3); }

.scenario-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.scenario {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.scenario-current { border-color: var(--accent); background: var(--accent-soft); }
.scenario-rate { display: flex; flex-direction: column; min-width: 110px; }
.sc-label { font-weight: 600; font-size: 13.5px; }
.sc-value { font-size: 12px; color: var(--text-3); }
.scenario-eta { display: flex; flex-direction: column; }
.sc-date { font-weight: 600; font-size: 13.5px; }
.sc-weeks { font-size: 12px; color: var(--text-3); }
.scenario .badge { margin-left: auto; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11.5px; font-weight: 600; }
.badge-neutral { background: var(--border); color: var(--text-2); }
.badge-info { background: #e4f1fa; color: var(--info); }
.badge-success { background: var(--accent-soft); color: var(--accent); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--text-3); }
.empty-icon { display: flex; justify-content: center; margin-bottom: 10px; opacity: 0.5; }
.empty-msg { font-weight: 500; color: var(--text-2); margin: 0; }
.empty-sub { font-size: 12.5px; margin: 4px 0 0; }

/* ---------------------------------------------------------------------------
 * Carte « Besoins du jour » — anneaux calories + macros
 * ------------------------------------------------------------------------ */
.card-note { font-size: 12px; color: var(--text-3); }
.macro-ring-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap; padding: 6px 4px;
}
.macro-item { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: 1; min-width: 120px; }
.macro-label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.macro-ring { line-height: 0; }
.ring { display: block; }
.ring-top { font-size: 21px; font-weight: 700; fill: var(--text); }
.ring-bottom { font-size: 12px; fill: var(--text-3); }
.macro-item:first-child .ring-top { font-size: 26px; }
.macro-quota { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.mq-target { font-size: 12.5px; font-weight: 600; color: var(--text); }
.mq-rest { font-size: 11.5px; color: var(--text-3); }
.macro-sep { width: 1px; align-self: stretch; background: var(--border); margin: 8px 4px; }

/* ---------------------------------------------------------------------------
 * Cartes de choix (sexe, activité, rythme)
 * ------------------------------------------------------------------------ */
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.choice-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 16px; border: 1.5px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); transition: 0.14s;
}
.choice-card:hover { border-color: var(--accent); background: var(--surface-2); }
.choice-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(47,158,143,0.12); }
.choice-emoji { font-size: 20px; }
.choice-title { font-weight: 600; font-size: 15px; }
.choice-desc { font-size: 12.5px; color: var(--text-2); }

/* ---------------------------------------------------------------------------
 * Assistant (onboarding page par page)
 * ------------------------------------------------------------------------ */
.wizard { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 20px 40px; }
.wizard-inner { width: 100%; max-width: 620px; }
.wz-progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.wz-step-count { font-size: 12.5px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; }
.wz-quit { background: none; border: none; color: var(--text-3); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.wz-quit:hover { color: var(--text-2); }
.wz-progress { height: 6px; background: var(--border); border-radius: 4px; overflow: hidden; margin-bottom: 28px; }
.wz-progress-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.35s ease; }
.wz-title { font-size: 26px; margin-bottom: 6px; }
.wz-subtitle { color: var(--text-2); margin: 0 0 26px; font-size: 15px; }
.wz-body { display: flex; flex-direction: column; gap: 16px; margin-bottom: 30px; }
.wz-body.wz-two { display: grid; grid-template-columns: 1fr 1fr; }
.wz-field-label, .wz-reco-label { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-top: 4px; }
.wz-reco-label { margin-top: 10px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-3); }
.wz-hint { font-size: 12px; color: var(--text-3); margin: 0; }
.wz-nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.wz-nav .btn { min-width: 130px; justify-content: center; }

.recap-grid { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.recap-row { display: flex; justify-content: space-between; padding: 11px 16px; border-bottom: 1px solid var(--border); }
.recap-row:last-child { border-bottom: none; }
.recap-row:nth-child(even) { background: var(--surface-2); }
.recap-label { color: var(--text-2); font-size: 13.5px; }
.recap-value { font-weight: 600; font-size: 13.5px; }

/* ---------------------------------------------------------------------------
 * Panneau de suggestion calorique
 * ------------------------------------------------------------------------ */
.suggestion-panel {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-2); padding: 18px 20px;
}
.sugg-box .suggestion-panel { margin-top: 6px; }
.sugg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.sugg-cal { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; color: var(--accent); }
.sugg-cal-unit { font-size: 14px; color: var(--text-2); font-weight: 500; }
.sugg-macros { display: flex; gap: 22px; flex-wrap: wrap; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.sugg-macro { display: flex; flex-direction: column; gap: 2px; }
.sm-dot { width: 22px; height: 5px; border-radius: 3px; }
.sm-value { font-size: 16px; font-weight: 700; margin-top: 4px; }
.sm-label { font-size: 12px; color: var(--text-3); }
.sugg-meta { display: flex; flex-direction: column; gap: 3px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.sugg-meta b { color: var(--text); font-weight: 600; }

/* ---------------------------------------------------------------------------
 * Import Apple Santé
 * ------------------------------------------------------------------------ */
.health-import { margin: 12px 0 8px; }
.health-file {
  font-size: 13px; padding: 8px; border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm); width: 100%; background: var(--surface-2);
}
.health-file::file-selector-button {
  border: none; background: var(--accent); color: #fff; padding: 7px 14px;
  border-radius: 7px; font-weight: 600; margin-right: 12px; cursor: pointer;
}
.health-status:empty { display: none; }

/* ---------------------------------------------------------------------------
 * Synchronisation : badge d'état + modale de connexion
 * ------------------------------------------------------------------------ */
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.sync-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12.5px; font-weight: 500; color: var(--text-2); text-align: left;
}
.sync-badge:hover { border-color: var(--border-strong); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex-shrink: 0; }
.sync-synced .sync-dot { background: var(--success); }
.sync-syncing .sync-dot { background: var(--info); animation: pulse 1s ease-in-out infinite; }
.sync-signedout .sync-dot { background: var(--warn); }
.sync-error .sync-dot { background: var(--danger); }
.sync-synced { color: var(--success); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.profiles-topbar { width: 100%; max-width: 920px; display: flex; justify-content: flex-end; margin-bottom: -20px; }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 28, 45, 0.4);
  display: grid; place-items: center; z-index: 200; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal {
  background: var(--surface); border-radius: var(--radius);
  padding: 26px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.modal-title { font-size: 20px; margin-bottom: 6px; }
.modal-sub { color: var(--text-2); font-size: 13px; margin: 0 0 18px; }
.modal .field { margin-bottom: 12px; }
.auth-err { color: var(--danger); font-size: 12.5px; min-height: 16px; margin: 2px 0 8px; }
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn { flex: 1; justify-content: center; }
.modal-close { display: block; margin: 14px auto 0; background: none; border: none; color: var(--text-3); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.modal-close:hover { color: var(--text-2); }

/* ---------------------------------------------------------------------------
 * Toast
 * ------------------------------------------------------------------------ */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-size: 13.5px; font-weight: 500; box-shadow: 0 8px 30px rgba(0,0,0,0.25);
  opacity: 0; pointer-events: none; transition: 0.25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------------------------------------------------------------------
 * Responsive (secondaire)
 * ------------------------------------------------------------------------ */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .analysis-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar-brand { padding: 6px 8px; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item.logout { margin-top: 0; }
  .dash-2col { grid-template-columns: 1fr; }
  .content { padding: 24px 20px 50px; }
}
@media (max-width: 680px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .analysis-tiles { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .page-head { flex-direction: column; }
}
