/* ===== Polices locales (Jour de Roses) — autonome, sans CDN ===== */
@font-face{font-family:'Playfair Display';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/playfairdisplay-600.woff2') format('woff2');}
@font-face{font-family:'Playfair Display';font-style:normal;font-weight:700;font-display:swap;src:url('fonts/playfairdisplay-700.woff2') format('woff2');}
@font-face{font-family:'Raleway';font-style:normal;font-weight:400;font-display:swap;src:url('fonts/raleway-400.woff2') format('woff2');}
@font-face{font-family:'Raleway';font-style:normal;font-weight:500;font-display:swap;src:url('fonts/raleway-500.woff2') format('woff2');}
@font-face{font-family:'Raleway';font-style:normal;font-weight:600;font-display:swap;src:url('fonts/raleway-600.woff2') format('woff2');}

/* ===== Charte graphique Jour de Roses ===== */
:root {
  --deep:      #4a0f38;  /* bordeaux / aubergine — titres, header */
  --brand:     #c63375;  /* rose magenta — boutons, liens, accents */
  --brand-dark:#a82a62;  /* rose foncé — survol */
  --soft:      #f3d1e1;  /* rose poudré — fonds doux */
  --soft-tint: #f9e8f0;  /* rose très clair — badges */
  --bg:        #faf6f7;  /* fond de page rosé */
  --card:      #ffffff;
  --ink:       #3d2f44;  /* texte principal */
  --muted:     #8a7f93;  /* texte secondaire */
  --line:      #f0e3ea;  /* bordures douces */
  --ok:        #15803d;
  --warn:      #b45309;
  --err:       #b91c1c;
  --pending:   #92400e;
  --shadow:    0 4px 18px rgba(74,15,56,.07);
  --shadow-sm: 0 1px 4px rgba(74,15,56,.06);
}
* { box-sizing: border-box; }
/* L'attribut [hidden] doit toujours l'emporter (sinon display:flex/grid le masque pas). */
[hidden] { display: none !important; }
body {
  margin: 0;
  font-family: 'Raleway', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
}
h1, h2, h3, .brand-text {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--deep);
  font-weight: 700;
  letter-spacing: .2px;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== Sidebar gauche (navigation) ===== */
:root { --sidebar-w: 230px; }

.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--card);
  border-right: 3px solid var(--brand);
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  padding: 1rem .85rem 1rem;
  z-index: 40;
  overflow-y: auto;
}
.sidebar-brand { display: flex; align-items: center; justify-content: center; padding: .4rem 0 1rem; }
.sidebar-brand img { max-width: 150px; width: 100%; height: auto; display: block; }

.sidebar-nav { flex: 1; }
.nav-top { list-style: none; margin: 0 0 .75rem; padding: 0; }
.nav-section { margin-bottom: 1rem; }
.nav-section-title {
  display: flex; align-items: center; gap: .4rem; width: 100%;
  margin: 0 0 .4rem; padding: .4rem .55rem; border: none; cursor: pointer;
  background: none; border-radius: 8px;
  font-size: .72rem; text-transform: uppercase; letter-spacing: .08em;
  font-weight: 700; color: var(--muted); font-family: inherit;
}
.nav-section-title:hover { background: var(--soft-tint); color: var(--brand-dark); }
.nav-section-title .nss-label { flex: 1; text-align: left; }
.nav-chevron { font-size: .7rem; transition: transform .18s; color: var(--muted); }
.nav-section:not(.collapsed) .nav-chevron { transform: rotate(90deg); }
.nav-section.collapsed .nav-links { display: none; }

/* Pastille de notification (« à faire ») */
.nav-badge {
  display: inline-block; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: #fff;
  font-size: .7rem; font-weight: 700; line-height: 18px; text-align: center;
  letter-spacing: 0;
}
.nav-link .nav-badge { margin-left: .35rem; }
.nav-links { list-style: none; margin: 0; padding: 0; }
.nav-links li { margin: .15rem 0; }
.nav-link {
  display: block; padding: .55rem .8rem; border-radius: 9px;
  color: var(--deep); font-weight: 600; font-size: .95rem;
}
.nav-link:hover { background: var(--soft-tint); color: var(--brand-dark); text-decoration: none; }
.nav-link.active { background: var(--brand); color: #fff; }
.nav-link.active:hover { background: var(--brand-dark); }

.sidebar-user {
  border-top: 1px solid var(--line);
  padding-top: .85rem; margin-top: .5rem;
}
.sidebar-user-name { display: block; color: var(--deep); font-weight: 700; margin-bottom: .6rem; padding: 0 .2rem; }
.sidebar-user-actions { display: flex; align-items: center; gap: .6rem; }
.sidebar-user-actions .pw-link { font-size: 1.15rem; text-decoration: none; line-height: 1; }
.sidebar-user-actions .logout {
  background: var(--brand); color: #fff; padding: .4rem .85rem; border-radius: 8px;
  font-weight: 600; font-size: .9rem; flex: 1; text-align: center;
}
.sidebar-user-actions .logout:hover { background: var(--brand-dark); text-decoration: none; }

/* ===== Barre mobile (cachée sur desktop) ===== */
.mobilebar {
  display: none;
  align-items: center; gap: 1rem;
  background: var(--card); border-bottom: 3px solid var(--brand);
  box-shadow: var(--shadow-sm); padding: .5rem 1rem;
  position: sticky; top: 0; z-index: 30;
}
.mobilebar-brand { display: flex; align-items: center; }
.mobilebar-brand img { height: 34px; width: auto; display: block; }
.hamburger {
  display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 42px; height: 42px; padding: 0 9px; border-radius: 9px;
  background: var(--soft-tint); border: none; cursor: pointer;
}
.hamburger:hover { background: var(--soft); }
.hamburger span { display: block; height: 3px; border-radius: 2px; background: var(--deep); }

/* Overlay sombre (mobile, derrière la sidebar) */
.sidebar-overlay {
  position: fixed; inset: 0; background: rgba(74,15,56,.45);
  z-index: 35;
}

/* ===== Zone de contenu (à droite de la sidebar) ===== */
.content { margin-left: var(--sidebar-w); }
.content-full { margin-left: 0; }

/* Layout */
.container { max-width: 1100px; margin: 1.75rem auto; padding: 0 1.5rem; }

/* Responsive : sidebar masquée, hamburger affiché */
@media (max-width: 860px) {
  .mobilebar { display: flex; }
  .content { margin-left: 0; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 270px;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  body:not(.nav-open) .sidebar-overlay { display: none; }
  .container { padding: 0 1rem; margin: 1.25rem auto; }
}
h1 { font-size: 1.8rem; margin: 0 0 1.1rem; }
h2 { font-size: 1.25rem; margin: 1.5rem 0 .75rem; }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 1.4rem; box-shadow: var(--shadow);
  margin-bottom: 1.25rem;
}
.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.stat {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 1.1rem 1.4rem; flex: 1; min-width: 130px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.stat::before { content:""; position:absolute; left:0; top:0; bottom:0; width:4px; background:var(--brand); }
.stat .num { font-family:'Playfair Display',serif; font-size: 2rem; font-weight: 700; color: var(--deep); }
.stat .lbl { color: var(--muted); font-size: .85rem; }

/* Flash */
.flash { padding: .75rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; font-weight: 500; }
.flash-ok { background: #ecfdf5; color: var(--ok); border-color: #a7f3d0; }
.flash-error { background: #fef2f2; color: var(--err); border-color: #fecaca; }
.flash-warn { background: #fffbeb; color: var(--warn); border-color: #fde68a; }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .65rem .5rem; border-bottom: 1px solid var(--line); }
th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-dark); font-weight: 700; }
tr:last-child td { border-bottom: none; }

/* Forms */
label { display: block; font-size: .85rem; color: var(--muted); margin: .6rem 0 .25rem; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
.form-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 160px; }

button, .btn {
  display: inline-block; cursor: pointer; border: none; border-radius: 10px;
  padding: .6rem 1.15rem; font-size: .95rem; font-weight: 600; font-family: 'Raleway', sans-serif;
  background: var(--brand); color: #fff; transition: background .15s;
}
button:hover, .btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-sm { padding: .35rem .7rem; font-size: .85rem; border-radius: 8px; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #126b32; }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #9b1414; }
.btn-ghost { background: var(--soft-tint); color: var(--brand-dark); }
.btn-ghost:hover { background: var(--soft); }
.inline-form { display: inline; }

/* Badges */
.badge { display: inline-block; padding: .18rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.badge-pending { background: #fef3c7; color: var(--pending); }
.badge-approved { background: #dcfce7; color: var(--ok); }
.badge-refused { background: #fee2e2; color: var(--err); }
.badge-type { background: var(--soft-tint); color: var(--brand-dark); }
.conflict { color: var(--err); font-weight: 600; }

.muted { color: var(--muted); font-size: .9rem; }
.empty { color: var(--muted); padding: 1.25rem; text-align: center; }

/* Login */
.login-wrap { max-width: 380px; margin: 7vh auto; }
.login-wrap .logo-big { display: block; margin: 0 auto 1.5rem; max-width: 230px; height: auto; }
.login-wrap .card { padding: 2rem; border-radius: 16px; }
body.login-page { background: linear-gradient(160deg, var(--soft) 0%, var(--bg) 55%); }

/* ===== Calendrier ===== */
.cal-layout { display: flex; gap: 1.25rem; align-items: flex-start; }
.cal-side { width: 240px; flex-shrink: 0; }
.cal-main { flex: 1; min-width: 0; }

.emp-list { list-style: none; margin: 0; padding: 0; }
.emp-list li { display: flex; align-items: center; gap: .55rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.emp-list li:last-child { border-bottom: none; }
.emp-name { font-weight: 600; font-size: .92rem; }
.emp-store { color: var(--muted); font-size: .78rem; margin-left: auto; }
.swatch { width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; border: 1px solid rgba(0,0,0,.1); }
.color-form { margin: 0; line-height: 0; }
.color-form input[type=color] {
  width: 26px; height: 26px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: none; cursor: pointer;
}
.color-form input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; }
.color-form input[type=color]::-webkit-color-swatch { border: none; border-radius: 4px; }

.cal-main { padding: 0; overflow: hidden; }

/* Entête des jours : collée en haut pendant le défilement */
.cal-dow-bar {
  display: grid; grid-template-columns: repeat(7, 1fr);
  position: sticky; top: 0; z-index: 5;
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 6px rgba(74,15,56,.06);
}
.cal-month-block { border-top: 8px solid var(--soft-tint); }
.cal-month-label {
  margin: 0; padding: .5rem .9rem; font-size: 1.15rem; color: var(--deep);
  background: #fff; border-bottom: 1px solid var(--line);
}
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow {
  padding: .55rem .4rem; text-align: center; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--brand-dark);
  background: var(--soft-tint); border-bottom: 1px solid var(--line);
}
.cal-dow.we { color: var(--deep); background: var(--soft); }
.cal-cell {
  min-height: 92px; padding: .3rem; border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line); position: relative; background: #fff;
}
.cal-week .cal-cell:nth-child(7) { border-right: none; }
.cal-cell.we { background: #fdf4f8; }            /* week-end : teinte rosée légère */
.cal-cell.out { background: #faf7f9; }
.cal-cell.out .cal-num { color: #c9bfca; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--brand); }
.cal-num { font-size: .82rem; font-weight: 700; color: var(--ink); text-align: right; padding: .1rem .25rem; }
.cal-cell.today .cal-num {
  color: #fff; background: var(--brand); border-radius: 50%;
  width: 22px; height: 22px; line-height: 22px; text-align: center; margin-left: auto; padding: 0;
}
.cal-chip {
  color: #fff; font-size: .74rem; font-weight: 600; padding: .12rem .4rem;
  border-radius: 6px; margin: .12rem 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; line-height: 1.35;
}

@media (max-width: 720px) {
  .cal-layout { flex-direction: column; }
  .cal-side { width: 100%; }
  .cal-cell { min-height: 64px; }
  .cal-chip { font-size: .68rem; }
}

/* ===== Chat ===== */
.chat-layout { display: flex; gap: 1.25rem; align-items: flex-start; }
.chat-rooms { width: 220px; flex-shrink: 0; }
.room-list { list-style: none; margin: 0; padding: 0; }
.room-list li { margin: .2rem 0; }
.room-list .room {
  display: block; padding: .55rem .7rem; border-radius: 9px; color: var(--deep);
  font-weight: 600; font-size: .92rem;
}
.room-list .room:hover { background: var(--soft-tint); text-decoration: none; }
.room-list .room.active { background: var(--brand); color: #fff; }

.chat-main { flex: 1; min-width: 0; padding: 0; display: flex; flex-direction: column; height: 70vh; }
.chat-header {
  padding: .8rem 1.1rem; border-bottom: 1px solid var(--line);
  font-family: 'Playfair Display', serif; font-weight: 700; color: var(--deep); font-size: 1.1rem;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; }
.msg { max-width: 78%; align-self: flex-start; }
.msg-meta { font-size: .72rem; color: var(--muted); margin: 0 .3rem .12rem; font-weight: 600; }
.msg-body {
  background: #fff; border: 1px solid var(--line); padding: .5rem .75rem;
  border-radius: 12px; border-top-left-radius: 4px; white-space: pre-wrap;
  word-wrap: break-word; box-shadow: var(--shadow-sm);
}
.msg.mine { align-self: flex-end; }
.msg.mine .msg-meta { text-align: right; }
.msg.mine .msg-body {
  background: var(--brand); color: #fff; border-color: var(--brand);
  border-radius: 12px; border-top-right-radius: 4px;
}
.msg.admin:not(.mine) .msg-body { background: var(--soft-tint); border-color: var(--soft); }
.msg.admin .msg-meta { color: var(--brand-dark); }

.chat-input { display: flex; gap: .6rem; padding: .75rem; border-top: 1px solid var(--line); }
.chat-input input { flex: 1; }

@media (max-width: 720px) {
  .chat-layout { flex-direction: column; }
  .chat-rooms { width: 100%; }
  .chat-main { height: 65vh; }
}

/* ===== Tableaux lisibles sur mobile =====
   Sur petit écran, on autorise le défilement horizontal des tableaux larges
   à l'intérieur d'une carte, sans toucher au rendu desktop.
   La carte du calendrier (.cal-main) est exclue : sa grille gère déjà sa largeur. */
@media (max-width: 720px) {
  .card:not(.cal-main):not(.chat-main) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .card:not(.cal-main):not(.chat-main) table { min-width: 520px; }
}

/* Icône emoji dans les entrées de menu */
.nav-ico { display: inline-block; width: 1.4em; text-align: center; margin-right: .15rem; }

/* ===== Widget chat ancré en bas (toutes pages) ===== */
.chat-widget { position: fixed; right: 20px; bottom: 20px; z-index: 60; }
.chat-launcher {
  position: relative; width: 58px; height: 58px; border-radius: 50%;
  background: var(--brand); color: #fff; border: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; box-shadow: 0 6px 20px rgba(74,15,56,.3);
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: background .15s, transform .15s;
}
.chat-launcher:hover { background: var(--brand-dark); transform: translateY(-2px); }
.chat-launcher.open { background: var(--brand-dark); }
.chat-badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px;
  padding: 0 5px; border-radius: 999px; background: var(--deep); color: #fff;
  font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center;
  border: 2px solid #fff;
}

.chat-panel {
  position: absolute; right: 0; bottom: 72px;
  width: 340px; height: 460px; max-height: calc(100vh - 110px);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 12px 40px rgba(74,15,56,.25);
  display: flex; flex-direction: column; overflow: hidden;
}
.cw-head {
  display: flex; align-items: center; gap: .5rem; padding: .6rem .7rem;
  border-bottom: 1px solid var(--line); background: var(--deep);
}
.cw-title { font-family: 'Playfair Display', serif; font-weight: 700; color: #fff; font-size: 1rem; }
.cw-room {
  flex: 1; width: auto; padding: .35rem .5rem; font-size: .85rem; border-radius: 8px;
  border: none; background: rgba(255,255,255,.15); color: #fff;
}
.cw-room option { color: var(--ink); }
.cw-close {
  background: transparent; color: #fff; border: none; cursor: pointer;
  font-size: 1.1rem; padding: .2rem .4rem; border-radius: 6px; width: auto;
}
.cw-close:hover { background: rgba(255,255,255,.2); }

.cw-messages { flex: 1; overflow-y: auto; padding: .75rem; display: flex; flex-direction: column; gap: .45rem; background: var(--bg); }
.cw-empty { color: var(--muted); text-align: center; margin: auto; font-size: .9rem; }
.cw-msg { max-width: 82%; align-self: flex-start; }
.cw-meta { font-size: .68rem; color: var(--muted); margin: 0 .3rem .1rem; font-weight: 600; }
.cw-body {
  background: #fff; border: 1px solid var(--line); padding: .4rem .65rem;
  border-radius: 12px; border-top-left-radius: 4px; font-size: .9rem;
  white-space: pre-wrap; word-wrap: break-word; box-shadow: var(--shadow-sm);
}
.cw-msg.mine { align-self: flex-end; }
.cw-msg.mine .cw-meta { text-align: right; }
.cw-msg.mine .cw-body { background: var(--brand); color: #fff; border-color: var(--brand); border-radius: 12px; border-top-right-radius: 4px; }
.cw-msg.admin:not(.mine) .cw-body { background: var(--soft-tint); border-color: var(--soft); }
.cw-msg.admin .cw-meta { color: var(--brand-dark); }

.cw-emojis {
  display: flex; flex-wrap: wrap; gap: .1rem; padding: .4rem .5rem;
  border-top: 1px solid var(--line); background: #fff; max-height: 132px; overflow-y: auto;
}
.cw-emoji { background: none; border: none; cursor: pointer; font-size: 1.25rem; padding: .15rem; width: auto; border-radius: 6px; }
.cw-emoji:hover { background: var(--soft-tint); }

.cw-input { display: flex; align-items: center; gap: .35rem; padding: .5rem; border-top: 1px solid var(--line); background: #fff; }
.cw-input input { flex: 1; padding: .5rem .65rem; }
.cw-emoji-btn, .cw-send {
  background: none; border: none; cursor: pointer; font-size: 1.3rem; padding: .25rem .35rem;
  width: auto; border-radius: 8px; color: var(--brand);
}
.cw-emoji-btn:hover, .cw-send:hover { background: var(--soft-tint); }
.cw-send { color: #fff; background: var(--brand); }
.cw-send:hover { background: var(--brand-dark); }

@media (max-width: 480px) {
  .chat-widget { right: 14px; bottom: 14px; }
  .chat-panel { width: calc(100vw - 28px); height: 70vh; bottom: 70px; }
}

/* ===== Tableau de bord ===== */
.stat-link { text-decoration: none; color: inherit; transition: transform .12s, box-shadow .12s; }
.stat-link:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(74,15,56,.12); text-decoration: none; }
.stat-alert { border-color: var(--brand); }
.stat-alert::before { background: var(--brand); width: 5px; }
.stat-alert .num { color: var(--brand); }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; align-items: start; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { display: flex; align-items: center; gap: .55rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.dash-list li:last-child { border-bottom: none; }

@media (max-width: 820px) {
  .dash-cols { grid-template-columns: 1fr; }
}

/* ===== Gestion des accès ===== */
.access-group, .access-emp {
  border: 1px solid var(--line); border-radius: 12px;
  padding: .9rem 1rem; margin-bottom: .9rem; background: #fff;
}
.access-group-head, .access-emp-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem;
}
.perm-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .35rem .9rem; margin: .5rem 0 .8rem;
}
.perm-check {
  display: flex; align-items: center; gap: .45rem; margin: 0;
  color: var(--ink); font-weight: 500; font-size: .92rem; cursor: pointer;
}
.perm-check input { width: auto; }

/* ===== To Do list ===== */
.todo-filter { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1.1rem; }
.todo-tab {
  padding: .35rem .8rem; border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); color: var(--deep);
}
.todo-tab:hover { background: var(--soft-tint); text-decoration: none; }
.todo-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item {
  display: flex; align-items: flex-start; gap: .7rem;
  padding: .8rem 0; border-bottom: 1px solid var(--line);
}
.todo-item:last-child { border-bottom: none; }

/* Case à cocher (boutons de formulaire) */
.todo-check-form { margin: 0; line-height: 0; flex-shrink: 0; padding-top: .15rem; }
.todo-check {
  width: 22px; height: 22px; padding: 0; border-radius: 6px;
  background: #fff; border: 2px solid var(--brand); color: #fff;
  font-size: .9rem; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.todo-check:hover { background: var(--soft); }
.todo-check.checked { background: var(--ok); border-color: var(--ok); }

/* Pastille d'urgence */
.pastille { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; margin-top: .35rem; }
.pastille.p-red    { background: var(--err); box-shadow: 0 0 0 3px #fee2e2; }
.pastille.p-orange { background: var(--warn); box-shadow: 0 0 0 3px #fef3c7; }
.pastille.p-green  { background: var(--ok); box-shadow: 0 0 0 3px #dcfce7; }

.todo-body { flex: 1; min-width: 0; }
.todo-title { font-weight: 600; color: var(--deep); font-size: 1rem; }
.todo-meta { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-top: .35rem; }
.todo-note { color: var(--muted); font-size: .88rem; margin-top: .35rem; white-space: pre-wrap; }

.imp-haute   { background: #fee2e2; color: var(--err); }
.imp-moyenne { background: #fef3c7; color: var(--pending); }
.imp-basse   { background: #e7f3ec; color: var(--ok); }
.badge-cat   { background: var(--soft); color: var(--deep); }
.badge.due   { background: var(--soft-tint); color: var(--brand-dark); }
.badge.due.due-soon { background: #fef3c7; color: var(--pending); }
.badge.due.due-late { background: #fee2e2; color: var(--err); }

.todo-actions { display: flex; align-items: flex-start; gap: .3rem; flex-shrink: 0; }
.todo-edit summary { list-style: none; cursor: pointer; }
.todo-edit summary::-webkit-details-marker { display: none; }
.todo-edit[open] { position: relative; }
.todo-edit-form {
  position: absolute; right: 0; z-index: 10; width: min(420px, 90vw);
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem; box-shadow: var(--shadow); margin-top: .4rem;
}
.todo-done-summary { cursor: pointer; font-weight: 700; color: var(--deep); font-family: 'Playfair Display', serif; }
.todo-item.done .todo-title { text-decoration: line-through; color: var(--muted); }

/* Tâches « à valider ? » signalées par la mise à jour automatique des mails */
.card-review { border: 1px solid var(--pending); background: #fffdf5; }
.todo-item.review { background: #fff9e8; border-radius: 10px; padding: .5rem .6rem; }
.review-reason { color: var(--pending); font-style: italic; }
.badge-auto { background: var(--soft-tint); color: var(--brand-dark); }

/* ===== Planning des équipes ===== */
.plan-head{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1.2rem;justify-content:space-between;}
.plan-nav{display:flex;align-items:center;gap:.6rem;}
.plan-week{font-weight:700;color:var(--brand-dark);}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:12px;border:1px solid var(--line);}
table.plan{border-collapse:collapse;width:100%;min-width:920px;background:var(--card);}
table.plan th,table.plan td{border:1px solid var(--line);padding:.35rem;vertical-align:top;text-align:left;}
table.plan thead th{background:var(--soft-tint);text-transform:none;letter-spacing:0;font-size:.8rem;text-align:center;}
.plan-day .plan-dnum{display:block;font-weight:500;color:var(--muted);font-size:.72rem;}
table.plan td.is-today{background:#fff6fb;}
table.plan thead th.is-today{background:var(--soft);}
.plan-emp{min-width:142px;}
.plan-emp .emp-name{display:block;font-weight:700;color:var(--ink);text-transform:none;letter-spacing:0;font-size:.9rem;}
.plan-emp .emp-meta{display:block;font-weight:500;color:var(--muted);font-size:.72rem;}
.plan-store-row td{background:var(--bg);font-weight:700;color:var(--brand-dark);text-transform:uppercase;letter-spacing:.04em;font-size:.78rem;}
.store-dot{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:.4rem;vertical-align:middle;}
.plan-cell{min-width:98px;}
.plan-shift{position:relative;display:block;color:#fff;border-radius:6px;padding:3px 5px;margin-bottom:3px;line-height:1.15;}
.plan-shift .ps-store{display:block;font-size:.66rem;font-weight:700;opacity:.95;}
.plan-shift .ps-time{display:block;font-size:.74rem;font-weight:600;}
.ps-del{position:absolute;top:1px;right:2px;margin:0;}
.ps-del button{background:rgba(255,255,255,.25);color:#fff;border:none;border-radius:4px;width:16px;height:16px;line-height:1;font-size:.8rem;cursor:pointer;padding:0;}
.ps-del button:hover{background:rgba(0,0,0,.25);}
.plan-conge{display:block;background:#e7edf0;color:#54646c;border-radius:6px;padding:3px 5px;font-size:.72rem;font-weight:600;margin-bottom:3px;}
.plan-repos{color:#b9b0bf;font-size:.72rem;font-style:italic;}
.plan-total{text-align:center;min-width:78px;white-space:nowrap;}
.plan-total .pt-h{display:block;font-weight:700;color:var(--ink);}
.plan-total .pt-d{display:block;font-size:.72rem;color:var(--muted);}
.plan-total.is-zero .pt-h{color:var(--muted);font-weight:600;}
.add-block{margin-top:1rem;}
.add-block summary{cursor:pointer;list-style:none;display:inline-block;}
.add-block summary::-webkit-details-marker{display:none;}
.add-block[open] summary{margin-bottom:.8rem;}
.plan-form .pf-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:.7rem;margin-bottom:.8rem;}
.plan-form label{display:flex;flex-direction:column;gap:.25rem;font-size:.85rem;font-weight:600;color:var(--ink);}
.plan-form select,.plan-form input{padding:.45rem;border:1px solid var(--line);border-radius:8px;font:inherit;background:#fff;}
.plan-legend{display:flex;flex-wrap:wrap;gap:.5rem 1.1rem;margin-top:1rem;color:var(--muted);font-size:.85rem;align-items:center;}
.plan-legend span{display:inline-flex;align-items:center;}
.plan-tools{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem 1rem;margin:1rem 0;}
.plan-tools form{margin:0;}

/* ===== Fiches salariés ===== */
.emp-toolbar{display:flex;gap:1rem;align-items:flex-start;flex-wrap:wrap;margin-bottom:1.25rem;}
.emp-toolbar > details{margin-bottom:0;flex:0 0 auto;}
.emp-search{flex:1;min-width:240px;}
.emp-search label{margin-top:0;}
.emp-search input{margin:0;}
.emp-noresult{text-align:center;}
.emp-fiche-head{display:flex;flex-direction:column;gap:.15rem;margin-bottom:.8rem;padding-bottom:.6rem;border-bottom:1px solid var(--line);}
.emp-form fieldset.fs{border:1px solid var(--line);border-radius:10px;padding:.7rem .9rem;margin:0 0 .8rem;}
.emp-form legend{font-size:.78rem;font-weight:700;color:var(--brand-dark);text-transform:uppercase;letter-spacing:.04em;padding:0 .4rem;}
.emp-form .form-row{gap:.8rem;}
.emp-form label{font-size:.82rem;font-weight:600;color:var(--ink);}
.emp-form input:disabled{color:var(--muted);}
.emp-actions{display:flex;flex-wrap:wrap;gap:.6rem;align-items:center;}

/* ===== Bandeau anniversaire ===== */
.birthday-banner{display:flex;align-items:center;gap:.7rem;margin:0 0 1.1rem;padding:.8rem 1rem;border-radius:12px;
  background:linear-gradient(90deg,#ffe3f1,#fff4d6);border:1px solid #f3c6dd;color:var(--ink);box-shadow:var(--shadow-sm);}
.birthday-banner .bb-cake{font-size:1.8rem;line-height:1;animation:bb-pop 1.6s ease-in-out infinite;}
.birthday-banner .bb-text{font-size:1.02rem;}
@keyframes bb-pop{0%,100%{transform:scale(1) rotate(0)}50%{transform:scale(1.18) rotate(-6deg)}}

/* ===== Notes Mag ===== */
.mag-dest{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem .8rem;margin-top:.8rem;}
.mag-dest-label{font-weight:600;color:var(--brand-dark);}
.mag-dest-opt{display:inline-flex;align-items:center;gap:.35rem;padding:.3rem .6rem;border:1px solid var(--line);
  border-radius:20px;cursor:pointer;font-size:.92rem;user-select:none;}
.mag-dest-opt input{margin:0;}
.mag-dest-gen{background:var(--soft);font-weight:600;}
.mag-dest-opt.is-disabled{opacity:.45;cursor:not-allowed;}
.mag-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin-top:1.1rem;}
.mag-col{margin:0;}
.mag-col-title{margin:0 0 .6rem;padding-bottom:.45rem;border-bottom:2px solid var(--brand);font-size:1.1rem;}
.mag-col .todo-list{margin:0;}
.mag-done{margin-top:.6rem;border-top:1px dashed var(--line);padding-top:.5rem;}
@media (max-width:820px){.mag-grid{grid-template-columns:1fr;}}
.plain-link{color:inherit;text-decoration:none;}
.plain-link:hover{color:var(--brand);text-decoration:underline;}

/* Bandeau date du jour (Notes Mag) */
.date-banner{display:flex;align-items:center;gap:.5rem;margin:0 0 1rem;padding:.6rem 1rem;
  border-radius:12px;background:var(--soft);border:1px solid var(--line);
  color:var(--brand-dark);font-weight:600;box-shadow:var(--shadow-sm);}
.date-banner .db-text{letter-spacing:.01em;}

/* ----- Rubrique Achats : tableaux denses ----- */
.data-table{width:100%;border-collapse:collapse;background:#fff;}
.data-table th, .data-table td{padding:.55rem .7rem;border-bottom:1px solid var(--line);text-align:left;font-size:.92rem;}
.data-table thead th{background:var(--soft);color:var(--brand-dark);font-weight:700;}
.data-table th.th-group{text-align:center;background:var(--soft-tint);border-bottom:2px solid var(--brand);}
.data-table td.num, .data-table th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;}
.data-table tbody tr:hover{background:var(--soft);}
.data-table .row-peak{background:#fff7ea;}
.data-table .row-peak:hover{background:#fff1d8;}
.data-table .row-total{background:var(--soft-tint);font-weight:600;}
.data-table .row-total:hover{background:var(--soft-tint);}

/* ----- Modulation : grille dense, 1re colonne figée ----- */
.modul-wrap{max-height:78vh;}
.modul-table{border-collapse:separate;border-spacing:0;}
.modul-table th, .modul-table td{padding:.35rem .4rem;font-size:.85rem;white-space:nowrap;}
.modul-table th.modul-stick, .modul-table td.modul-stick{
  position:sticky;left:0;background:#fff;z-index:2;border-right:2px solid var(--brand);min-width:170px;}
.modul-table thead th{position:sticky;top:0;z-index:3;}
.modul-table thead th.modul-stick{z-index:4;}
.modul-week, .modul-total, .modul-contract{text-align:center;}
.modul-table .plan-store-row td{
  position:sticky;left:0;background:var(--soft);font-weight:600;color:var(--brand-dark);
  padding:.35rem .8rem;border-top:1px solid var(--line);}
.modul-cell{padding:2px;}
.modul-input{width:44px;text-align:center;border:1px solid var(--line);border-radius:6px;
  padding:2px 2px;font-variant-numeric:tabular-nums;background:#fff;}
.modul-input:focus{outline:2px solid var(--brand);outline-offset:-1px;}
.modul-input.is-pos{background:#eaf8ee;color:#196b32;font-weight:600;}
.modul-input.is-neg{background:#fdecec;color:#a8221d;font-weight:600;}
.modul-total.is-pos{color:#196b32;font-weight:700;}
.modul-total.is-neg{color:#a8221d;font-weight:700;}
.modul-contract{color:var(--muted);}
.modul-delta{font-size:.7rem;text-align:center;font-weight:600;margin-top:1px;line-height:1;}
.modul-delta.is-pos{color:#196b32;}
.modul-delta.is-neg{color:#a8221d;}

/* ----- Modulation v2 : 3 sous-lignes Skello / Ajust / Total ----- */
.modul-table-3 td, .modul-table-3 th { padding: .25rem .35rem; }
.modul-table-3 .modul-lbl{font-size:.72rem;color:var(--muted);font-weight:600;text-transform:uppercase;
  letter-spacing:.04em;padding-right:.6rem;min-width:60px;background:#fff;}
.modul-table-3 td.modul-lbl{position:sticky;left:170px;z-index:2;}
.modul-table-3 thead th.modul-lbl{position:sticky;left:170px;z-index:5;}
.modul-table-3 .modul-row-sk{background:#fbfaf7;}
.modul-table-3 .modul-row-aj{background:#fff;}
.modul-table-3 .modul-row-tot{background:#f5f0e8;border-bottom:2px solid var(--brand-dark);}
.modul-sk{background:#fff;}
.modul-aj{background:#fff;color:#1d4ea8;font-weight:600;}
.modul-tot{text-align:center;font-variant-numeric:tabular-nums;line-height:1.05;}
.modul-tot-val{font-weight:700;font-size:.9rem;}
.modul-tot.is-pos .modul-tot-val{color:#196b32;}
.modul-tot.is-neg .modul-tot-val{color:#a8221d;}
