/* OPERA Cockpit : bleu nuit, or et ivoire, Fraunces pour les titres et les chiffres, IBM Plex Sans pour le texte.
   Mise en page : barre latérale sur ordinateur, en-tête et navigation du bas sur téléphone. */
:root {
  --navy: #0E1A2B;
  --navy-2: #1B2A40;
  --navy-line: #2E3E57;
  --gold: #C9A24B;
  --gold-hover: #D8B35E;
  --gold-ink: #7A5C14;
  --gold-ink-hover: #5C4410;
  --ivory: #F5F2EA;
  --paper: #FBFAF6;
  --white: #FFFFFF;
  --line: #E4DED0;
  --line-soft: #EFEAE0;
  --field-line: #CFC7B5;
  --ink: #16202E;
  --muted: #3F4756;
  --sand: #D9D3C4;
  --ok: #1E7A46;
  --ok-ink: #1E6B3A;
  --ok-bg: #EAF5EE;
  --ok-line: #B9DCC4;
  --vig: #F0A030;
  --vig-ink: #7A4400;
  --vig-bg: #FFF4E0;
  --vig-line: #F0C98A;
  --urg: #C62828;
  --urg-ink: #9E1C12;
  --urg-bg: #FDECEA;
  --urg-line: #E9B4AE;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', 'Segoe UI', system-ui, sans-serif;
  --radius-card: 16px;
  --radius-field: 10px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ivory);
  font-variant-numeric: tabular-nums;
}
a { color: var(--gold-ink); }
a:hover { color: var(--gold-ink-hover); }
h1, h2, h3, .h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; margin: 0; text-wrap: balance; }
h1 { font-size: 28px; }
h2 { font-size: 21px; }
.h3 { font-size: 18px; }
p { margin: 0; }
.icon { flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; }
.skip:focus { left: 16px; z-index: 100; background: var(--white); padding: 10px 14px; border-radius: 8px; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted); }
.small { font-size: 14px; }
.label { font-weight: 600; font-size: 15px; }
.mono { font-family: Consolas, 'Courier New', monospace; letter-spacing: .04em; }
.gold-ink { color: var(--gold-ink); }
.up { color: var(--ok-ink); }
.down { color: var(--urg-ink); }
.warn-ink { color: var(--vig-ink); }
.neutral { color: var(--muted); }
.req { color: var(--urg-ink); }

.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stack-small { display: flex; flex-direction: column; gap: 8px; }
.stack-tight { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Coquille de l'application ---------- */
.shell { min-height: 100vh; }
.sidebar { display: none; }
.main { min-width: 0; }
.brand { display: flex; align-items: baseline; gap: 8px; }
.brand-opera { font-family: var(--font-display); font-size: 22px; font-weight: 600; letter-spacing: .08em; color: var(--gold); }
.brand-cockpit { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--sand); }

.m-header {
  background: var(--navy);
  color: var(--white);
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.m-header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.m-header-est { font-size: 14px; color: var(--sand); }
.m-header .btn-pill { white-space: nowrap; }

.consultant-banner {
  background: var(--vig-bg);
  border-bottom: 1px solid var(--vig-line);
  padding: 10px 16px;
  font-size: 14px;
}

.content {
  padding: 22px 16px calc(100px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 20px;
  max-width: 1180px;
}

.m-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--white);
  border-top: 1px solid var(--line);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px));
}
.m-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 54px; border-radius: 10px;
  font-size: 12px; font-weight: 600; color: var(--muted); text-decoration: none;
}
.m-nav a.is-active { color: var(--navy); background: var(--ivory); }

.sidebar-est { display: flex; flex-direction: column; gap: 3px; padding: 0 6px; }
.sidebar-est-name { font-size: 16px; font-weight: 600; }
.sidebar-est-meta { font-size: 13px; color: var(--sand); }
.sidebar-small-link { font-size: 13px; color: var(--gold); }
.sidebar-small-link:hover { color: var(--gold-hover); }
.sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 12px;
  min-height: 46px; padding: 0 14px; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: var(--sand); text-decoration: none;
}
.sidebar-nav a:hover { background: rgba(255, 255, 255, .06); color: var(--white); }
.sidebar-nav a.is-active { background: var(--navy-2); color: var(--gold); }
.sidebar-spacer { flex-grow: 1; }
.sidebar-back { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 8px; color: var(--gold); font-weight: 600; text-decoration: none; }
.sidebar-back:hover { color: var(--gold-hover); }
.sidebar-user { border-top: 1px solid var(--navy-line); padding: 14px 6px 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.sidebar-user-name { font-weight: 600; }
.sidebar-user-links { display: flex; gap: 14px; align-items: center; }
.sidebar-user-links a, .sidebar .link-button { color: var(--sand); }
.sidebar-user-links a:hover, .sidebar .link-button:hover { color: var(--white); }
.legend { display: flex; gap: 12px; font-size: 12px; color: var(--sand); padding: 0 6px; }
.legend span, .with-dot { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; flex-shrink: 0; }
.dot-ok { background: #3FAE6E; }
.dot-vig { background: var(--vig); }
.dot-urg { background: #E5534B; }
.dot-na { background: var(--field-line); }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-ink); cursor: pointer; text-decoration: underline; min-height: 32px; }

@media (min-width: 900px) {
  .shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: 22px;
    background: var(--navy); color: var(--white);
    padding: 28px 18px 22px;
    position: sticky; top: 0; height: 100vh; overflow-y: auto;
  }
  .sidebar .brand { padding: 0 6px; }
  .sidebar .brand-opera { font-size: 26px; }
  .m-header, .m-nav { display: none; }
  .consultant-banner { padding: 10px 36px; }
  .content { padding: 30px 36px 56px; gap: 22px; }
  h1 { font-size: 32px; }
}

/* ---------- En-tête de page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--gold-ink); }
.lead { color: var(--muted); max-width: 70ch; }
.week-nav { display: flex; align-items: center; gap: 6px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 4px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 10px; color: var(--ink); text-decoration: none;
}
.icon-btn:hover { background: var(--ivory); color: var(--ink); }

/* ---------- Cartes ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
  min-width: 0;
}
.card-quiet { background: var(--paper); }
.card-gold { border-color: var(--gold); }
fieldset.card { margin: 0; }
fieldset.card legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; }
fieldset.card legend + * { clear: both; }
details.card summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.empty { align-items: flex-start; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px;
  border-radius: 12px; border: 1px solid transparent;
  background: var(--navy); color: var(--white);
  font: inherit; font-size: 15px; font-weight: 600; line-height: 1.2;
  text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: var(--navy-2); color: var(--white); }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: var(--gold-hover); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--field-line); }
.btn-ghost:hover { background: var(--white); color: var(--ink); }
.btn-danger-ghost { background: transparent; color: var(--urg-ink); border-color: var(--urg-line); }
.btn-danger-ghost:hover { background: var(--urg-bg); color: var(--urg-ink); }
.btn-small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-pill { min-height: 40px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.btn-block { width: 100%; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label { font-weight: 600; font-size: 15px; }
.field > label.small { font-weight: 500; font-size: 13px; color: var(--muted); }
.field .help { font-size: 13px; color: var(--muted); }
.field-card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
input[type=text], input[type=email], input[type=password], input[type=date], textarea, select {
  width: 100%; min-height: 48px;
  border: 1px solid var(--field-line); border-radius: var(--radius-field);
  padding: 0 12px;
  font: inherit; font-size: 17px;
  background: var(--paper); color: var(--ink);
}
textarea { padding: 10px 12px; min-height: 92px; resize: vertical; line-height: 1.45; font-size: 16px; }
input:focus, textarea:focus, select:focus { outline: 3px solid rgba(201, 162, 75, .45); outline-offset: 0; border-color: var(--gold); }
input[readonly] { background: var(--line-soft); color: var(--muted); }
.field.has-error input { border-color: var(--urg); background: var(--white); }
.error-text { font-size: 13px; font-weight: 600; color: var(--urg-ink); }
.input-unit { position: relative; }
.input-unit input { padding-right: 58px; }
.input-unit .unit { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; color: var(--muted); pointer-events: none; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.inline-form label { font-weight: 600; }
.inline-form input[type=date] { width: auto; min-width: 180px; }

/* ---------- Messages ---------- */
.notice {
  display: flex; flex-direction: column; gap: 6px;
  border: 1px solid; border-radius: 12px; padding: 12px 16px;
  font-size: 15px; line-height: 1.45;
}
.notice ul { margin: 0; padding-left: 18px; }
.notice-success { background: var(--ok-bg); border-color: var(--ok-line); color: #123D24; }
.notice-warn { background: var(--vig-bg); border-color: var(--vig-line); color: #4A2A00; }
.notice-error { background: var(--urg-bg); border-color: var(--urg-line); color: #6E140C; }
.notice-info { background: var(--white); border-color: var(--gold); color: var(--ink); }

/* ---------- Statuts ---------- */
.pill {
  align-self: flex-start;
  display: inline-flex; align-items: center;
  font-size: 12px; font-weight: 700; line-height: 1.4;
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.pill-ok { background: var(--ok); color: var(--white); }
.pill-vig { background: var(--vig); color: #3A2400; }
.pill-urg { background: var(--urg); color: var(--white); }
.pill-na { background: var(--line-soft); color: var(--muted); }
.pill-demo { background: var(--line-soft); color: var(--gold-ink); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center;
  min-height: 40px; padding: 0 14px;
  border: 1px solid var(--field-line); border-radius: 999px;
  background: var(--white); color: var(--ink);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.chip:hover { border-color: var(--gold); color: var(--ink); }

/* ---------- Chiffres ---------- */
.big { font-family: var(--font-display); font-size: 44px; font-weight: 600; line-height: 1; }
.comps { display: flex; flex-direction: column; border-top: 1px solid var(--line-soft); }
.comp {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.3fr); gap: 8px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft); align-items: center;
}
.comp-label { font-size: 13px; color: var(--muted); }
.comp-ref { font-size: 14px; text-align: right; }
.comp-var { font-size: 14px; font-weight: 600; text-align: right; }

.tiles { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile {
  background: var(--white); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; display: flex; flex-direction: column; gap: 5px; min-width: 0;
}
.tile-vig { border-color: var(--vig-line); }
.tile-urg { background: #FFF7F6; border: 2px solid #E9A29B; }
.tile-na { border-style: dashed; border-color: var(--field-line); }
.tile-name { font-size: 13px; color: var(--muted); }
.tile-value { font-family: var(--font-display); font-size: 28px; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.tile-sub { font-size: 12px; color: var(--muted); }

.facts { display: flex; flex-direction: column; gap: 0; margin: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.credentials dd { font-size: 17px; }

/* ---------- Prévision & N-1 ---------- */
.prev-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1400px) { .prev-layout { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); } }
.prev-table { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 4px 16px; }
.prev-row {
  display: grid; gap: 8px 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
  align-items: end;
}
.prev-day, .prev-var { grid-column: 1 / -1; }
.prev-day { display: flex; flex-direction: column; gap: 1px; }
.prev-day-name { font-size: 15px; font-weight: 700; }
.prev-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mini-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.prev-row input { min-height: 44px; font-size: 16px; text-align: right; padding: 0 10px; }
.prev-row input.pv { border: 2px solid var(--gold); background: var(--white); font-weight: 600; }
.prev-row.is-locked input.pv { border: 1px solid var(--field-line); background: var(--line-soft); }
.prev-var { font-size: 13px; font-weight: 600; }
.prev-head { display: none; }
.prev-total { border-bottom: 0; font-weight: 700; align-items: center; }
.prev-total .num { display: flex; flex-direction: column; gap: 2px; }
.prev-total [data-total-var] { grid-column: 1 / -1; }
.num { text-align: right; }
@media (min-width: 760px) {
  .prev-row { grid-template-columns: minmax(0, 1.6fr) 118px 96px 126px minmax(0, 1fr); align-items: center; padding: 10px 0; }
  .prev-day, .prev-var { grid-column: auto; }
  .prev-var { text-align: right; }
  .prev-head { display: grid; font-size: 12px; font-weight: 700; color: var(--muted); padding: 12px 0; }
  .prev-cell .mini-label, .prev-total .mini-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .prev-total [data-total-var] { grid-column: auto; }
  .var-long { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
.fill-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; }

/* ---------- Espace consultant ---------- */
.client-list { display: flex; flex-direction: column; gap: 12px; }
.client {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 16px 18px;
  display: grid; gap: 12px 18px; grid-template-columns: minmax(0, 1fr);
}
.client.is-archived { opacity: .7; }
.client-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.client-name { font-size: 20px; }
.client-name a { color: var(--ink); text-decoration: none; }
.client-name a:hover { color: var(--gold-ink); text-decoration: underline; }
.client-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.client-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
@media (min-width: 1000px) {
  .client { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) auto; align-items: center; }
  .client-actions { justify-content: flex-end; }
}
.settings-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1180px) { .settings-layout { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } }
.targets { display: flex; flex-direction: column; gap: 14px; }
.target-row { display: grid; gap: 8px 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; }
.target-label { grid-column: 1 / -1; font-weight: 600; }
@media (min-width: 720px) {
  .target-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); }
  .target-label { grid-column: auto; align-self: center; }
}
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.member { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.member-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Pages simples : connexion, compte, erreurs ---------- */
body.plain { background: var(--navy); }
.plain-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; gap: 22px;
  padding: calc(40px + env(safe-area-inset-top, 0px)) 16px calc(32px + env(safe-area-inset-bottom, 0px));
}
.plain-brand { text-decoration: none; }
.plain-brand .brand-opera { font-size: 30px; }
.plain-card {
  width: 100%; max-width: 460px;
  background: var(--white); border-radius: 18px;
  padding: 28px 24px;
  display: flex; flex-direction: column; gap: 18px;
}
.plain-foot { color: var(--sand); font-size: 13px; }
.list-link {
  display: flex; align-items: center; min-height: 52px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); font-weight: 600; text-decoration: none;
}
.list-link:hover { border-color: var(--gold); color: var(--ink); }

/* ---------- Étape 2 : tableaux de bord et plan d'actions ---------- */
.m-header-link { color: var(--gold); font-size: 14px; font-weight: 600; white-space: nowrap; }
.m-header-link:hover { color: var(--gold-hover); }
.m-header .m-header-row + .m-header-row { align-items: baseline; }
.week-nav-label { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0 6px; text-align: center; }
.icon-btn.is-disabled { color: var(--field-line); pointer-events: none; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px; }
.section-head h2 { font-size: 22px; }
.card-title-small { font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--muted); }
.strong { font-weight: 600; }
.field-wide { grid-column: 1 / -1; }
.eyebrow-gold { color: var(--gold); }

.gains { border-color: var(--gold); display: grid; gap: 14px 22px; grid-template-columns: minmax(0, 1fr); align-items: center; }
@media (min-width: 1000px) { .gains { grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1.15fr); } }
.gains-main { display: flex; flex-direction: column; gap: 2px; }
.gains-total { font-family: var(--font-display); font-size: 36px; font-weight: 600; line-height: 1.05; color: var(--ok-ink); }
.gains-none { font-size: 26px; color: var(--muted); }
.gains-months { display: flex; flex-direction: column; gap: 6px; }
.month-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.month-chip { background: var(--ivory); border-radius: 10px; padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; }
.month-chip strong { font-size: 17px; }
.gains-detail { font-size: 15px; line-height: 1.5; }

.week-top { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1000px) { .week-top { grid-template-columns: 280px minmax(0, 1fr); } .week-top > :last-child { grid-column: 1 / -1; } }
@media (min-width: 1300px) { .week-top { grid-template-columns: 280px minmax(0, 1fr) minmax(0, 1.15fr); } .week-top > :last-child { grid-column: auto; } }
.stake { background: var(--navy-2); border-color: var(--navy-2); color: var(--white); gap: 8px; }
.stake-amount { font-family: var(--font-display); font-size: 48px; font-weight: 600; line-height: 1.05; color: var(--gold); }
.stake-label { font-size: 16px; }
.stake-text { font-size: 14px; line-height: 1.5; color: var(--sand); }

.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: end; height: 124px; }
.bar-col { position: relative; height: 118px; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; }
.bar { border-radius: 5px 5px 0 0; min-height: 0; }
.bar-ok { background: var(--ok); }
.bar-vig { background: var(--vig); }
.bar-urg { background: var(--urg); }
.bar-na { background: var(--field-line); }
.bar-mark { position: absolute; left: -3px; right: -3px; height: 3px; background: var(--navy); border-radius: 2px; }
.bar-closed { font-size: 11px; color: var(--muted); text-align: center; writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; margin-bottom: 6px; }
.bar-labels { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; text-align: center; }
.bar-labels > div { display: flex; flex-direction: column; gap: 1px; font-size: 13px; }
.bar-var { font-size: 11px; font-weight: 700; }
.bar-var-ok { color: var(--ok-ink); }
.bar-var-vig { color: var(--vig-ink); }
.bar-var-urg { color: var(--urg-ink); }
.bar-var-na { color: var(--muted); font-weight: 500; }

.badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 9px; }
.badge-urg { background: var(--urg-bg); color: var(--urg-ink); }
.badge-vig { background: var(--vig-bg); color: var(--vig-ink); }
.badge-ok { background: var(--ok-bg); color: var(--ok-ink); }

.tiles-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px) { .tiles-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1300px) { .tiles-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.tiles.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.recos { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .recos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.reco { border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.reco-ok { background: var(--ok-bg); border-color: var(--ok-line); }
.reco-vig { background: var(--vig-bg); border-color: var(--vig-line); }
.reco-urg { background: var(--urg-bg); border-color: var(--urg-line); }
.reco-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.reco-title { font-size: 18px; }
.reco-block { display: flex; flex-direction: column; gap: 3px; font-size: 15px; line-height: 1.45; }
.reco-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.reco-label.gold-ink { color: var(--gold-ink); }
.reco-reflexe { background: var(--white); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; line-height: 1.4; }
.reco-gain { font-size: 14px; font-weight: 600; color: var(--ok-ink); }
.btn-ok-ghost { background: var(--white); color: var(--ok-ink); border-color: var(--ok-line); }
.btn-ok-ghost:hover { background: var(--ok-bg); color: var(--ok-ink); }

.day-top { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .day-top { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); } }

.actions-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1150px) { .actions-layout { grid-template-columns: 360px minmax(0, 1fr); } }
.brief-card { background: var(--navy); border-color: var(--navy); color: var(--white); }
.brief-card h2 { font-size: 21px; }
.brief-meta { color: var(--sand); }
.things { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; }
.things li { display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.45; color: var(--sand); }
.things li::marker { font-family: var(--font-display); font-weight: 600; color: var(--gold); }
.things strong { font-size: 15px; color: var(--white); }
.progress { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; display: flex; }
.progress-done { background: var(--ok); }
.progress-run { background: #8FA2C4; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--field-line); background: var(--white); color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.filter:hover { border-color: var(--navy); color: var(--ink); }
.filter.is-active { background: var(--navy); border-color: var(--navy); color: var(--white); }
.action-list { list-style: none; margin: 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-card); }
.action { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px 14px; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); scroll-margin-top: 16px; }
.action:last-child { border-bottom: 0; }
.action.is-done .action-title { color: var(--muted); }
.pillar-badge { width: 36px; height: 36px; border-radius: 999px; background: var(--navy); color: var(--gold); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.action-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.action-title { font-family: var(--font-body); font-size: 16px; font-weight: 600; line-height: 1.35; }
.action-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.late { color: var(--urg-ink); font-weight: 600; }
.action-kpi { display: flex; flex-direction: column; gap: 2px; font-size: 14px; background: var(--paper); border-radius: 10px; padding: 8px 12px; }
.action-kpi-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.action-side { grid-column: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
@media (min-width: 760px) {
  .action { grid-template-columns: 40px minmax(0, 1fr) 150px; }
  .action-side { grid-column: auto; flex-direction: column; align-items: flex-end; gap: 6px; }
}
.status-btn { min-height: 40px; padding: 0 14px; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.status-0 { background: var(--line-soft); color: var(--muted); border: 1px solid #D8D0BF; }
.status-1 { background: #E3E8F2; color: var(--navy-2); border: 1px solid #C3CCDD; }
.status-2 { background: var(--ok); color: var(--white); border: 1px solid var(--ok); }
.link-danger { color: var(--urg-ink); }
.closed-form { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.closed-card { align-items: flex-start; }

/* ---------- Étape 3 : brief du lundi, Copilot, espace consultant ---------- */
.count-badge { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: var(--navy); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.pill-moyen { background: #E3E8F2; color: var(--navy-2); }
.brief-lundi { border-color: var(--gold); }
.brief-text, .bubble-text { white-space: pre-line; line-height: 1.55; font-size: 15px; overflow-wrap: anywhere; }
.data-block { margin: 0; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-family: Consolas, 'Courier New', monospace; font-size: 12px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 520px; overflow-y: auto; }
.brief-editor { min-height: 420px; font-size: 15px; line-height: 1.55; }
.client-brief { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) {
  .client { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .client-main, .client-actions { grid-column: 1 / -1; }
  .client-actions { justify-content: flex-start; }
}
@media (min-width: 1400px) {
  .client { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, 1fr) auto; }
  .client-main, .client-actions { grid-column: auto; }
  .client-actions { justify-content: flex-end; }
}
@media (min-width: 700px) {
  .client-brief { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; }
  .client-brief .client-main, .client-brief .client-actions { grid-column: auto; }
  .client-brief .client-actions { justify-content: flex-end; }
}
.question.is-open { border-color: var(--vig-line); }
.question-text { font-size: 16px; font-weight: 600; }
.answer { background: var(--ok-bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
details summary { cursor: pointer; }

.copilot-layout { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1150px) { .copilot-layout { grid-template-columns: minmax(0, 1fr) 340px; } }
.chat { background: var(--paper); gap: 12px; }
.chat-log { display: flex; flex-direction: column; gap: 14px; max-height: 68vh; overflow-y: auto; padding: 4px 2px 8px; }
.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.bubble { max-width: 96%; border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.bubble-user { max-width: 86%; background: var(--navy); color: var(--white); border-bottom-right-radius: 4px; }
.bubble-user .bubble-author { color: var(--sand); }
.bubble-ia { background: var(--white); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bubble-consultant { background: var(--vig-bg); border: 1px solid var(--vig-line); border-bottom-left-radius: 4px; }
.bubble-author { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-ink); }
.bubble-recos { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.bubble-reco { background: var(--ivory); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.bubble-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 8px; }
.added { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ok-ink); }
.chat-system { text-align: center; }
.chat-form { display: flex; gap: 10px; align-items: center; background: var(--white); border: 1px solid var(--field-line); border-radius: 14px; padding: 6px 6px 6px 14px; }
.chat-form input { border: 0; background: transparent; padding: 0; min-height: 44px; }
.chat-form input:focus { outline: none; }
.chat-form:focus-within { outline: 3px solid rgba(201, 162, 75, .45); border-color: var(--gold); }
.chat-wait { text-align: center; }
.copilot-id { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.copilot-avatar { width: 38px; height: 38px; border-radius: 999px; background: var(--gold); color: var(--navy); display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.suggestion { width: 100%; min-height: 44px; padding: 8px 14px; border: 1px solid #D8D0BF; border-radius: 12px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.suggestion:hover { border-color: var(--gold); }
button[disabled] { opacity: .6; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
