/* ===== Thème Alustor =====
   Tout le visuel passe par ces variables : pour reprendre exactement le style
   de Pilotage, il suffit d'ajuster ce bloc (couleurs, rayons, police). */
:root {
  /* Palette Barevo Groupe : greige, anthracite, bleu marine */
  --bg: #f4f2ed;
  --card: #ffffff;
  --ink: #2f2f2c;
  --muted: #7a7a72;
  --line: #e6e3da;
  --side: #14213d;
  --side-ink: #cfd3dc;
  --greige: #cdc9bd;
  --accent: #1b2a4e;
  --accent-soft: #ebe8de;
  --ok: #10b981;
  --warn: #eab308;
  --bad: #ef4444;
  --info: #0ea5e9;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(20, 33, 61, .06);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
h1 { font-size: 26px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0 0 6px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* structure */
.layout { display: flex; min-height: 100vh; }
.side { width: 240px; background: var(--side); color: var(--side-ink); padding: 18px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; }
.brand { color: #fff; padding: 4px 12px 20px; }
.wordmark { font-weight: 300; font-size: 26px; letter-spacing: 6px; line-height: 1; text-align: center; }
.wordmark small { display: block; font-size: 10px; letter-spacing: 7px; margin-top: 7px; opacity: .8; }
.wordmark small::before, .wordmark small::after { content: ""; display: inline-block; width: 22px; height: 1px; background: currentColor; vertical-align: middle; margin: 0 8px; opacity: .6; }
.wordmark.dark { color: var(--accent); font-size: 32px; }
.side nav { flex: 1; overflow-y: auto; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; margin-bottom: 3px; font-weight: 500; transition: .15s; }
.side a.nav:hover { background: rgba(255,255,255,.08); color: #fff; }
.side a.nav.active { background: var(--greige); color: var(--side); font-weight: 700; }
.side .sep { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .55; padding: 14px 14px 6px; }
.pill { margin-left: auto; background: var(--bad); color: #fff; border-radius: 999px; font-size: 12px; padding: 1px 8px; font-weight: 700; }
.me { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid rgba(255,255,255,.1); color: #fff; }
.me .who { font-size: 13px; line-height: 1.2; flex: 1; }
.me .who small { opacity: .6; display: block; }
.main { flex: 1; padding: 28px 32px 60px; max-width: 1280px; min-width: 0; }
.topbar { display: none; }

/* composants */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { justify-content: space-between; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.btn { display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 12px; padding: 10px 18px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; font-size: 14px; font-family: inherit; transition: .15s; }
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn.ghost { background: var(--accent-soft); color: var(--accent); }
.btn.grey { background: #eef1f7; color: var(--ink); }
.btn.ok { background: var(--ok); } .btn.bad { background: var(--bad); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
input, select, textarea { font: inherit; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 90px; resize: vertical; }
label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--ink); }
.check input { width: auto; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; background: #eef1f7; color: var(--muted); }
.badge.pending { background: #fef9c3; color: #a16207; }
.badge.approved, .badge.done { background: #d1fae5; color: #047857; }
.badge.refused { background: #fee2e2; color: #b91c1c; }
.badge.new { background: #dbeafe; color: #1d4ed8; }
.badge.annonce { background: var(--greige); color: var(--side); }
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-weight: 500; animation: pop .3s; }
.flash.ok { background: #d1fae5; color: #065f46; } .flash.error { background: #fee2e2; color: #991b1b; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.list > * + * { border-top: 1px solid var(--line); }
.item { padding: 11px 0; }
.empty { text-align: center; color: var(--muted); padding: 22px 0; }
.empty .big { font-size: 34px; }
details.card summary { cursor: pointer; font-weight: 700; list-style: none; }
details.card summary::before { content: "＋ "; color: var(--accent); }
details[open].card summary::before { content: "− "; }

/* accueil */
.hero { background: linear-gradient(120deg, var(--side), #2b3d68); color: #fff; border-radius: 22px; padding: 26px 30px; margin-bottom: 22px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.hero h1 { font-size: 28px; }
.hero .stat { background: rgba(255,255,255,.12); border-radius: 16px; padding: 12px 20px; text-align: center; }
.hero .stat b { font-size: 26px; display: block; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 22px; }
.tile { background: var(--card); border-radius: 20px; padding: 22px; box-shadow: var(--shadow); transition: .2s; display: block; border: 2px solid transparent; }
.tile:hover { transform: translateY(-4px) rotate(-.4deg); border-color: var(--accent); }
.tile .ico { font-size: 34px; margin-bottom: 8px; }
.tile.off { opacity: .55; }

/* planning & congés (grilles) */
.scroll { overflow-x: auto; }
table.cal { border-collapse: separate; border-spacing: 4px; width: 100%; min-width: 760px; }
table.cal th { font-size: 13px; color: var(--muted); font-weight: 600; padding: 6px; text-align: center; }
table.cal th.today, table.cal td.today { background: #e3e0d4; }
table.cal td { background: #faf9f6; border-radius: 10px; vertical-align: top; padding: 5px; min-width: 120px; height: 64px; font-size: 12px; }
table.cal td.name { background: none; min-width: 140px; font-weight: 600; font-size: 14px; }
.chip { display: block; border-radius: 8px; padding: 3px 7px; margin-bottom: 3px; font-weight: 600; background: #dfe3ee; color: #1b2a4e; }
.chip.leave { background: #d1fae5; color: #065f46; } .chip.pending { background: #fef9c3; color: #854d0e; }
.chip.chantier { background: #e7dfcf; color: #6b5a33; } .chip.livraison { background: #cffafe; color: #155e75; }
.chip.atelier { background: #ede9fe; color: #5b21b6; } .chip.reunion { background: #fce7f3; color: #9d174d; }
.chip.formation { background: #fef9c3; color: #854d0e; }
.chip form { display: inline; } .chip button { border: 0; background: none; cursor: pointer; opacity: .5; padding: 0 0 0 4px; }
table.month td { height: 34px; min-width: 26px; text-align: center; padding: 2px; }
table.month td.w { background: #ece9df; }

/* fils */
.post { padding: 16px 0; }
.post.pinned { background: var(--accent-soft); margin: 0 -20px; padding: 16px 20px; border-radius: 14px; }
.bubble { background: #f1efe8; border-radius: 14px; padding: 8px 12px; margin: 6px 0; }
.bubble b { font-size: 13px; }
pre.txt { white-space: pre-wrap; font-family: inherit; margin: 0; }

/* connexion */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--side), #2b3d68); padding: 20px; }
.login-card { background: #fff; border-radius: 24px; padding: 36px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }

/* confettis */
.confetti { position: fixed; top: -12px; width: 10px; height: 14px; z-index: 99; animation: fall 2.6s linear forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(105vh) rotate(720deg); opacity: .8; } }

@media (max-width: 860px) {
  .layout { display: block; }
  .side { position: fixed; left: -260px; z-index: 50; transition: .25s; width: 250px; }
  .side.open { left: 0; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .topbar { display: flex; align-items: center; justify-content: space-between; background: var(--side); color: #fff; padding: 12px 16px; position: sticky; top: 0; z-index: 40; }
  .topbar button { background: none; border: 0; color: #fff; font-size: 26px; }
  .main { padding: 18px 14px 50px; }
}

/* ratios direction */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.kpi { background: var(--card); border-radius: 20px; padding: 20px 22px; box-shadow: var(--shadow); border-top: 5px solid var(--greige); }
.kpi-h { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.kpi-v { font-size: 32px; font-weight: 800; color: var(--accent); margin: 6px 0 2px; letter-spacing: -.5px; }
.kpi-s { font-size: 13px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); line-height: 1.5; }
.delta { font-weight: 700; } .delta.up { color: #047857; } .delta.down { color: #b91c1c; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; margin-right: 4px; }
.dot.navy { background: var(--side); } .dot.sand { background: var(--greige); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 190px; }
.bar-col { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.bar-pair { flex: 1; display: flex; align-items: flex-end; gap: 2px; }
.bar { flex: 1; border-radius: 5px 5px 0 0; min-height: 0; transition: .2s; }
.bar.navy { background: var(--side); } .bar.sand { background: var(--greige); }
.bar-col:hover .bar { filter: brightness(1.15); }
.bar-l { font-size: 10px; text-align: center; color: var(--muted); margin-top: 5px; white-space: nowrap; }
svg.line { width: 100%; height: auto; }
table.fin { width: 100%; border-collapse: collapse; min-width: 820px; font-size: 14px; }
table.fin th { text-align: right; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
table.fin td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); }
table.fin th:first-child, table.fin td:first-child { text-align: left; }
code { background: #eee9dc; padding: 1px 6px; border-radius: 6px; font-size: 12px; }

/* ratios : onglets société, 3 chiffres prioritaires */
.tabs { display: flex; gap: 8px; margin: 16px 0 18px; flex-wrap: wrap; }
.tab { padding: 10px 24px; border-radius: 999px; background: #ebe8de; color: var(--ink); font-weight: 700; transition: .15s; }
.tab:hover { background: var(--greige); }
.tab.on { background: var(--side); color: #fff; }
.kpis.main3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.kpi.big { border-top-width: 6px; border-top-color: var(--side); padding: 24px 26px; }
.kpi.big .kpi-v { font-size: 40px; }
.kpis.sec3 { margin-top: 16px; }
.kpi.small-k { padding: 16px 20px; box-shadow: none; border: 1px solid var(--line); border-top: 4px solid var(--greige); }
.kpi.small-k .kpi-v { font-size: 24px; }
.soc-title { font-size: 14px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 6px 0 8px; }

/* messagerie et tâches */
.chat { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: start; }
.chat-people { padding: 8px; max-height: 70vh; overflow-y: auto; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.person:hover, .person.active { background: var(--accent-soft); }
.person .pname { display: flex; flex-direction: column; line-height: 1.2; flex: 1; min-width: 0; }
.msgs { max-height: 50vh; overflow-y: auto; padding: 6px 2px; }
.msg { display: flex; margin: 6px 0; }
.msg.mine { justify-content: flex-end; }
.msg .bubble { max-width: 80%; }
.msg.mine .bubble { background: var(--greige); }
.bubble.task { border: 2px solid var(--warn); }
.compose { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.task { padding: 10px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; }
@media (max-width: 760px) { .chat { grid-template-columns: 1fr; } .chat-people { max-height: 200px; } }
