:root {
  --orange: #EB9B3F;
  --orange-d: #C97F2A;
  --orange-l: #F4B86A;
  --navy: #00274E;
  --navy-2: #073461;
  --navy-3: #0E4A82;
  --cream: #FBF6EE;
  --cream-2: #F3EADB;
  --ink: #1E2A38;
  --muted: #6B7785;
  --line: #E7DECF;
  --ok: #2E9E6B;
  --warn: #D98324;
  --crit: #E2533F;
  --shadow: 0 8px 28px rgba(0, 39, 78, 0.10);
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--cream); color: var(--ink); -webkit-font-smoothing: antialiased; }
.app { display: flex; height: 100vh; }

/* sidebar */
.sidebar { width: 252px; flex: 0 0 252px; background: var(--navy); color: #DCE6F1; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; padding: 46px 18px 22px; }
.brand-mark { width: 50px; height: 50px; border-radius: 12px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 21px; font-weight: 700; color: #fff; }
.brand-tag { font-size: 10.5px; color: var(--orange-l); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; }
.nav-item { display: flex; align-items: center; gap: 11px; background: transparent; border: 0; color: #C4D2E2; font-size: 14.5px; text-align: left; padding: 11px 12px; border-radius: 10px; cursor: pointer; transition: background .15s, color .15s; }
.nav-item .ni-ic { color: var(--orange); width: 18px; text-align: center; font-size: 14px; }
.nav-item:hover { background: var(--navy-2); color: #fff; }
.nav-item.active { background: var(--orange); color: var(--navy); font-weight: 600; }
.nav-item.active .ni-ic { color: var(--navy); }
.side-foot { margin-top: auto; padding: 14px 18px 16px; }
.terr { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: #9FB3C9; text-transform: uppercase; letter-spacing: .6px; }
.terr select { background: var(--navy-2); color: #fff; border: 1px solid var(--navy-3); border-radius: 8px; padding: 8px 9px; font-size: 13px; }
.side-note { font-size: 10.5px; color: #708AA4; margin: 14px 0 0; line-height: 1.4; }

/* main */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: 64px; flex: 0 0 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 26px; border-bottom: 1px solid var(--line); -webkit-app-region: drag; }
.crumb { font-size: 15px; font-weight: 600; color: var(--navy); padding-left: 60px; }
.top-actions { display: flex; align-items: center; gap: 12px; -webkit-app-region: no-drag; }
.period { font-size: 12.5px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; }
.btn-export { background: var(--navy); color: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.btn-export:hover { background: var(--navy-3); }

.scroll { overflow-y: auto; padding: 24px 26px; flex: 1; }
.view { display: none; animation: fade .25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
h2 { font-size: 22px; color: var(--navy); margin: 2px 0 6px; }
.lead { color: var(--muted); margin: 0 0 18px; font-size: 14px; max-width: 760px; }

/* agg banner */
.agg-banner { display: flex; align-items: center; gap: 12px; background: #EAF1F4; border: 1px solid #CFE0E8; color: var(--navy); border-radius: 12px; padding: 12px 16px; font-size: 13px; margin-bottom: 18px; }
.agg-ic { font-size: 18px; }

/* KPI */
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .k-num { font-size: 28px; font-weight: 800; color: var(--navy); letter-spacing: .3px; }
.kpi .k-lbl { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.kpi .k-trend { font-size: 11.5px; font-weight: 700; margin-top: 8px; }
.kpi .k-trend.up { color: var(--ok); } .kpi .k-trend.down { color: var(--crit); } .kpi .k-trend.flat { color: var(--muted); }
.kpi.accent { background: var(--navy); }
.kpi.accent .k-num { color: #fff; } .kpi.accent .k-lbl { color: var(--orange-l); }

/* panels */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .panels { grid-template-columns: 1fr; } }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.panel h3 { margin: 0 0 14px; font-size: 14.5px; color: var(--navy); }
.panel h3 .hint { color: var(--muted); font-weight: 400; font-size: 12px; }

/* vertical bars */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.bars .bar { flex: 1; background: var(--orange); border-radius: 5px 5px 0 0; position: relative; min-height: 4px; transition: opacity .2s; }
.bars .bar.low { background: var(--navy-3); }
.bars .bar:hover { opacity: .8; }
.bars .bar span { position: absolute; bottom: -20px; left: 0; right: 0; text-align: center; font-size: 9.5px; color: var(--muted); }

/* horizontal bars */
.hbars { display: flex; flex-direction: column; gap: 11px; }
.hbar { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: 10px; font-size: 12.5px; }
.hbar .hb-lbl { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .hb-track { background: var(--cream-2); border-radius: 999px; height: 12px; overflow: hidden; }
.hbar .hb-fill { background: var(--orange); height: 100%; border-radius: 999px; }
.hbar .hb-val { text-align: right; color: var(--muted); font-weight: 600; }

/* stat list */
.stat-list { display: flex; flex-direction: column; gap: 14px; }
.stat-row { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.stat-row:last-child { border-bottom: 0; }
.stat-row .sr-lbl { font-size: 13px; color: var(--muted); }
.stat-row .sr-val { font-size: 18px; font-weight: 700; color: var(--navy); }

/* table */
.table { display: flex; flex-direction: column; gap: 0; }
.trow { display: grid; grid-template-columns: 1fr 1fr 70px; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.trow.head { font-weight: 700; color: var(--navy); border-bottom: 2px solid var(--line); font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; }
.trow:last-child { border-bottom: 0; }
.trow .pax { text-align: right; font-weight: 600; color: var(--navy); }

/* needs */
.needs { display: flex; flex-wrap: wrap; gap: 10px; }
.need-tag { background: var(--cream-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; color: var(--ink); }
.need-tag b { color: var(--orange-d); }

/* communication */
.comm-layout { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }
@media (max-width: 980px) { .comm-layout { grid-template-columns: 1fr; } }
.comm-form { display: flex; flex-direction: column; gap: 12px; }
.f-lbl { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--muted); font-weight: 600; }
.f-lbl input, .f-lbl select, .f-lbl textarea { border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; font-size: 14px; background: var(--cream); color: var(--ink); font-family: inherit; resize: vertical; }
.f-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-primary { background: var(--orange); color: var(--navy); border: 0; border-radius: 10px; padding: 11px 14px; font-weight: 700; font-size: 14px; cursor: pointer; }
.btn-primary:hover { background: var(--orange-d); color: #fff; }
.src-note { font-size: 11.5px; color: var(--warn); background: #FBEFD9; border-radius: 8px; padding: 9px 11px; margin: 4px 0 0; line-height: 1.4; }
.block-title { font-size: 14.5px; color: var(--navy); margin: 0 0 12px; }
.pub { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 10px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 10px; }
.pub.urgent { border-left-color: var(--crit); }
.pub.important { border-left-color: var(--warn); }
.pub-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pub-type { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--orange-d); }
.pub.urgent .pub-type { color: var(--crit); } .pub.important .pub-type { color: var(--warn); }
.pub-time { font-size: 11px; color: var(--muted); }
.pub-title { font-weight: 700; color: var(--navy); font-size: 14.5px; margin: 6px 0 3px; }
.pub-body { font-size: 13px; color: var(--ink); line-height: 1.45; }
.pub-meta { font-size: 11px; color: var(--muted); margin-top: 8px; }
.pub-meta .chip-t { background: var(--cream-2); border-radius: 999px; padding: 2px 8px; margin-right: 6px; }

/* toast */
.toast-wrap { position: fixed; right: 22px; bottom: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast { background: var(--navy); color: #fff; padding: 13px 17px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,39,78,.28); font-size: 13.5px; max-width: 360px; border-left: 4px solid var(--ok); animation: slide .3s ease; }
@keyframes slide { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ===== Graphique avec échelle ===== */
.chart-scaled { display: grid; grid-template-columns: 34px 1fr; gap: 8px; align-items: stretch; }
.y-axis { position: relative; height: 150px; }
.y-axis .yt { position: absolute; right: 0; transform: translateY(-50%); font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; height: 150px; }
.chart-plot .gridline { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); z-index: 0; }
.chart-plot .bars { position: relative; z-index: 1; height: 150px; padding-top: 0; }
.bars .bar span.val { position: absolute; top: -16px; bottom: auto; left: 0; right: 0; text-align: center; font-size: 9.5px; font-weight: 700; color: var(--navy); opacity: 0; transition: opacity .15s; }
.bars .bar:hover span.val { opacity: 1; }
.chart-cap { font-size: 11px; color: var(--muted); margin-top: 24px; font-style: italic; }

/* échelle des barres horizontales */
.hb-scale { display: grid; grid-template-columns: 130px 1fr 44px; gap: 10px; margin-top: 6px; }
.hb-ruler { position: relative; height: 14px; }
.hb-ruler i { position: absolute; top: 0; transform: translateX(-50%); font-size: 9.5px; color: var(--muted); font-style: normal; font-variant-numeric: tabular-nums; }
.hb-ruler i:first-child { transform: translateX(0); }
.hb-ruler i:last-child { transform: translateX(-100%); }

/* ===== Comparaison saisonnière ===== */
.season-compare { display: grid; grid-template-columns: 30px 1fr; gap: 8px; }
.sc-scale { display: flex; flex-direction: column; justify-content: space-between; height: 150px; font-size: 10px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.sc-bars { display: flex; align-items: flex-end; gap: 22px; height: 150px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0 12px; position: relative; }
.sc-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; }
.sc-bar-wrap { width: 100%; max-width: 70px; height: 100%; display: flex; align-items: flex-end; }
.sc-bar { width: 100%; background: var(--orange); border-radius: 6px 6px 0 0; position: relative; min-height: 4px; transition: opacity .2s; }
.sc-bar.low { background: var(--navy-3); }
.sc-bar:hover { opacity: .85; }
.sc-bar .sc-v { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 800; color: var(--navy); }
.sc-lbl { font-size: 11px; color: var(--ink); margin-top: 8px; text-align: center; }

/* ===== Projection économique (exemple) ===== */
.proj-eco { background: linear-gradient(180deg, #fffdf8, #fff); border: 1px dashed var(--orange, #EB9B3F); }
.proj-head { display: flex; align-items: center; gap: 10px; }
.proj-tag { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--orange-d, #B97A12); background: var(--gold-soft, #f6e9d2); border-radius: 999px; padding: 3px 10px; }
.proj-intro { font-size: 13px; color: var(--muted, #6a7683); margin: 8px 0 16px; line-height: 1.5; }
.proj-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.proj-card { background: var(--navy, #00274E); color: #fff; border-radius: 14px; padding: 18px; text-align: center; }
.proj-num { font-size: 26px; font-weight: 800; color: #fff; }
.proj-lbl { font-size: 12px; color: #cfe0ec; margin-top: 4px; }
.proj-note { font-size: 11.5px; color: var(--muted, #6a7683); font-style: italic; margin-top: 14px; }
