/* =====================================================================
   styles.css — Interface "console métier" : barre latérale, thème par
   profil, tableaux de bord. Sobre & professionnel, responsive.
   ===================================================================== */
:root {
  --bg: #f3f3ef;
  --surface: #ffffff;
  --text: #1a1f2b;
  --text-soft: #6b7280;
  --border: #e4e4dc;
  --shadow: 0 1px 2px rgba(16, 38, 66, .04), 0 6px 20px rgba(16, 38, 66, .06);
  --radius: 14px;

  /* Couleur d'accent (surchargée par le thème du profil) */
  --primary: #1d4e89;
  --primary-dark: #163a66;
  --primary-soft: #eaf1fb;

  --sidebar-bg: #1a2235;
  --sidebar-fg: #9da8b7;

  /* Statuts */
  --st-recu: #2563eb;    --st-recu-bg: #e7effe;
  --st-attente: #c2730b; --st-attente-bg: #fdf0db;
  --st-cours: #6d28d9;   --st-cours-bg: #f0e9fb;
  --st-resolu: #15803d;  --st-resolu-bg: #e3f4e9;
  --st-ferme: #64748b;   --st-ferme-bg: #eef1f5;
}

/* Thèmes par profil ---------------------------------------------------- */
body[data-theme="bleu"]   { --primary: #1d4e89; --primary-dark: #163a66; --primary-soft: #e8f0fa; }
body[data-theme="vert"]   { --primary: #2e7d4f; --primary-dark: #225e3b; --primary-soft: #e4f3ea; }
body[data-theme="violet"] { --primary: #6d28d9; --primary-dark: #561fab; --primary-soft: #f0e9fb; }
body[data-theme="orange"] { --primary: #c2730b; --primary-dark: #9a5b08; --primary-soft: #fbeedd; }

* { box-sizing: border-box; }
body {
  margin: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6; font-size: 16px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef1f5; padding: .1em .35em; border-radius: 4px; font-size: .9em; }
.muted { color: var(--text-soft); }

/* ---------- Coquille ---------- */
.app-shell { display: flex; min-height: 100vh; }

/* ---------- Barre latérale ---------- */
.sidebar {
  width: 248px; flex-shrink: 0; background: var(--sidebar-bg); color: var(--sidebar-fg);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand {
  display: flex; align-items: center; gap: .75rem; color: #fff; padding: 1.4rem 1.3rem;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.sidebar__brand:hover { text-decoration: none; }
.sidebar__brand-icon { font-size: 1.4rem; }
.sidebar__brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar__brand-text strong { font-size: .95rem; letter-spacing: -.01em; }
.sidebar__brand-text small { opacity: .55; font-size: .72rem; }

.sidebar__nav { flex: 1; padding: 1rem .75rem; overflow-y: auto; }
.sidebar__link {
  display: flex; align-items: center; gap: .75rem; color: var(--sidebar-fg);
  padding: .65rem .9rem; border-radius: 10px; font-size: .9rem; margin-bottom: .2rem;
  letter-spacing: -.01em; transition: background .12s, color .12s;
}
.sidebar__link:hover { text-decoration: none; background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar__link.is-active { background: var(--primary); color: #fff; font-weight: 600; }
.sidebar__icon { font-size: 1rem; width: 1.25rem; text-align: center; opacity: .8; }

.sidebar__user {
  display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.sidebar__user-text { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar__user-text strong { color: #fff; font-size: .9rem; }
.sidebar__user-text small { font-size: .72rem; opacity: .7; }
.avatar {
  width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem;
}

.sidebar-backdrop { display: none; }

/* ---------- Zone principale ---------- */
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 1rem; background: var(--primary); color: #fff;
  padding: .85rem 1.6rem; position: sticky; top: 0; z-index: 10;
  box-shadow: 0 1px 0 rgba(0,0,0,.12);
}
.topbar__title { font-size: 1.05rem; margin: 0; flex: 1; font-weight: 600; letter-spacing: -.01em; }
.topbar__menu { display: none; background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }
.profile-select { display: flex; align-items: center; gap: .4rem; }
.profile-select__label { font-size: .85rem; opacity: .9; }
.profile-select select {
  border: none; border-radius: 6px; padding: .35rem .5rem; cursor: pointer;
  background: rgba(255, 255, 255, .18); color: #fff; font-size: .85rem;
}
.profile-select select option { color: var(--text); }

.app-root { padding: 2rem 2rem 3rem; flex: 1; }
/* En mode "collègue" : pas de barre latérale, contenu centré et aéré. */
body[data-mode="simple"] .sidebar,
body[data-mode="simple"] .topbar__menu { display: none; }
body[data-mode="simple"] .app-root { max-width: 860px; margin: 0 auto; width: 100%; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block; border: 1px solid transparent; border-radius: 10px; padding: .7rem 1.4rem;
  font-size: .93rem; font-weight: 600; cursor: pointer; transition: background .15s, transform .1s; text-align: center; letter-spacing: -.01em;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--primary:disabled { background: #c5ced9; cursor: not-allowed; color: #fff; }
.btn--ghost { background: #fff; border-color: var(--border); color: var(--primary); }
.btn--ghost:hover { background: var(--primary-soft); border-color: var(--primary); }
.back-link { display: inline-flex; align-items: center; gap: .3rem; margin-bottom: 1.2rem; font-size: .88rem; color: var(--text-soft); }
.back-link:hover { color: var(--primary); text-decoration: none; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.6rem; margin-bottom: 1.4rem;
}
.card h2 { margin-top: 0; font-size: 1.05rem; font-weight: 700; letter-spacing: -.02em; }
.section-title { margin: 0 0 1.1rem; font-size: 1rem; font-weight: 700; letter-spacing: -.01em; }

/* ---------- Accueil (collègue) ---------- */
.hero { text-align: center; margin: 2rem 0 2.5rem; }
.hero h1 { margin: 0 0 .5rem; font-size: 1.9rem; font-weight: 700; letter-spacing: -.03em; }
.hero__sub { color: var(--text-soft); margin: 0; font-size: 1rem; }
.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.action-card {
  display: flex; flex-direction: column; gap: .6rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2rem 1.6rem; color: var(--text); transition: transform .15s, box-shadow .15s;
}
.action-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: 0 8px 28px rgba(16,38,66,.1); }
.action-card__icon { font-size: 2.2rem; }
.action-card__title { font-size: 1.15rem; font-weight: 700; color: var(--primary); letter-spacing: -.02em; }
.action-card__desc { color: var(--text-soft); font-size: .9rem; line-height: 1.5; }

/* ---------- Formulaires ---------- */
.form-card { max-width: 620px; margin: 0 auto; }
.field { display: flex; flex-direction: column; gap: .35rem; margin-bottom: 1rem; }
.field > span { font-weight: 600; font-size: .9rem; }
.field--inline { flex-direction: row; align-items: center; gap: .5rem; margin-bottom: 0; }
.field--inline > span { font-weight: 600; font-size: .85rem; white-space: nowrap; }
select, input[type="text"], textarea {
  width: 100%; font: inherit; padding: .7rem .85rem; border: 1.5px solid var(--border);
  border-radius: 10px; background: #fff; color: var(--text); font-size: .95rem;
  transition: border-color .15s;
}
select:focus, input:focus, textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft);
}
textarea { resize: vertical; }
.inline-form { display: flex; gap: .6rem; margin: .5rem 0 1rem; flex-wrap: wrap; }
.inline-form input { flex: 1; min-width: 180px; }
.routing-preview { background: var(--primary-soft); color: var(--primary-dark); padding: .6rem .8rem; border-radius: 8px; font-size: .92rem; margin: 0; }
.pole-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: .3rem; }
.pole-grid--single { grid-template-columns: 1fr; }
.pole-section-label { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-soft); margin: .9rem 0 .2rem; }
.pole-section-label--session { color: #5b4fcf; }
.pole-section-label--autre { color: var(--text-soft); }

.pole-card {
  background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; font-size: .95rem; font-weight: 500; color: var(--text);
  cursor: pointer; text-align: left; transition: border-color .15s, background .15s;
  display: flex; flex-direction: column; gap: .3rem;
}
.pole-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.pole-card.is-selected { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); font-weight: 700; }

/* Zone connexion / session — violet doux */
.pole-card--session { border-color: #c4b8f5; background: #f5f3ff; }
.pole-card--session:hover { border-color: #7c6fe0; background: #ede9ff; }
.pole-card--session.is-selected { border-color: #5b4fcf; background: #ede9ff; color: #3d2fa0; }

/* Zone autre — gris discret */
.pole-card--autre { opacity: .85; }
.pole-card--autre:hover { opacity: 1; }

.pole-card__title { font-weight: 600; font-size: .95rem; }
.pole-card__desc { font-size: .8rem; font-weight: 400; color: var(--text-soft); line-height: 1.4; }
.pole-card.is-selected .pole-card__desc { color: var(--primary-dark); }
.pole-card--session.is-selected .pole-card__desc { color: #3d2fa0; }
.pole-card__details { font-size: .8rem; font-weight: 400; margin-top: .2rem; }
.pole-card__details summary { cursor: pointer; color: #5b4fcf; font-size: .8rem; }
.pole-card__list { margin: .4rem 0 0 1rem; padding: 0; color: var(--text-soft); line-height: 1.6; }

@media (max-width: 599px) { .next-hide-mobile { display: none; } }
.photo-sim { margin-top: .5rem; padding: .6rem .8rem; background: #f7f9fc; border: 1px dashed var(--border); border-radius: 8px; font-size: .9rem; }
.photo-preview { margin-top: .7rem; display: flex; flex-direction: column; gap: .4rem; }
.photo-preview img { max-width: 200px; border-radius: 8px; border: 1px solid var(--border); }
input[type="file"] { font-size: .9rem; cursor: pointer; }
.form-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.2rem; }

/* ---------- Stepper ---------- */
.stepper-wrap { margin-bottom: 1.8rem; }
.stepper { display: flex; list-style: none; padding: 0; margin: 0; gap: 0; }
.stepper li {
  display: flex; align-items: center; gap: .4rem; font-size: .78rem;
  color: var(--text-soft); flex: 1; position: relative;
  padding-bottom: .6rem; border-bottom: 2px solid var(--border);
  letter-spacing: .01em; text-transform: uppercase; font-weight: 500;
  white-space: nowrap; overflow: hidden; min-width: 0;
}
.stepper li span { display: none; }
.stepper li.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }
.stepper li.is-done { color: var(--st-resolu); border-bottom-color: var(--st-resolu); }
.stepper-mobile { display: none; }
@media (max-width: 540px) {
  .stepper { display: none; }
  .stepper-mobile {
    display: block; margin: 0; font-size: .82rem; font-weight: 600;
    color: var(--primary); padding-bottom: .7rem;
    border-bottom: 2px solid var(--primary);
  }
}

/* ---------- Récap, confirmation ---------- */
.recap { display: grid; grid-template-columns: 130px 1fr; gap: .5rem 1rem; margin: 0; }
.recap dt { font-weight: 600; color: var(--text-soft); }
.recap dd { margin: 0; }
.confirm { text-align: center; max-width: 480px; margin: 2rem auto; }
.confirm__icon { font-size: 3rem; display: block; margin-bottom: .5rem; }
.confirm__id { font-size: 1.7rem; font-weight: 800; letter-spacing: 2px; color: var(--primary); background: var(--primary-soft); display: inline-block; padding: .5rem 1.4rem; border-radius: 12px; }
.confirm__actions { display: flex; gap: .8rem; justify-content: center; margin-top: 1.4rem; flex-wrap: wrap; }

/* ---------- Badges de statut ---------- */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.badge--recu { background: var(--st-recu-bg); color: var(--st-recu); }
.badge--attente { background: var(--st-attente-bg); color: var(--st-attente); }
.badge--cours { background: var(--st-cours-bg); color: var(--st-cours); }
.badge--resolu { background: var(--st-resolu-bg); color: var(--st-resolu); }
.badge--ferme { background: var(--st-ferme-bg); color: var(--st-ferme); }

/* ---------- Priorités ---------- */
.prio { font-size: .82rem; font-weight: 700; white-space: nowrap; }
.prio--haute { color: #c0392b; }
.prio--normale { color: #4a6fa5; }
.prio--basse { color: #6b7280; }

/* ---------- Cartes de statistiques ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .9rem; margin-bottom: 1.2rem; }
.stat-grid--4 { grid-template-columns: repeat(4, 1fr); }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: .9rem 1rem; font-size: .82rem; color: var(--text-soft);
  border-top: 3px solid var(--border); display: block; text-decoration: none;
  transition: box-shadow .15s, transform .15s;
}
a.stat { cursor: pointer; }
a.stat:hover { box-shadow: 0 4px 16px rgba(16,38,66,.13); transform: translateY(-2px); text-decoration: none; }
.stat__num { display: block; font-size: 2rem; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -.04em; margin-bottom: .2rem; }
.stat--accent { border-top-color: var(--primary); }
.stat--recu { border-top-color: var(--st-recu); }
.stat--attente { border-top-color: var(--st-attente); }
.stat--cours { border-top-color: var(--st-cours); }
.stat--resolu { border-top-color: var(--st-resolu); }

/* ---------- Grille tableau de bord ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.dash-grid .card { margin-bottom: 0; }

/* ---------- Donut + légende ---------- */
.donut { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }
.donut__total { font-size: 1.7rem; font-weight: 800; fill: var(--text); }
.legend { list-style: none; margin: 0; padding: 0; font-size: .88rem; }
.legend li { display: flex; align-items: center; gap: .5rem; padding: .15rem 0; }
.legend-dot { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; }

/* ---------- Barres horizontales ---------- */
.hbars { list-style: none; margin: 0; padding: 0; }
.hbar { display: grid; grid-template-columns: 60px 1fr 28px; align-items: center; gap: .6rem; margin-bottom: .55rem; }
.hbar__label { font-weight: 600; font-size: .85rem; }
.hbar__track { background: #eef1f5; border-radius: 6px; height: .7rem; overflow: hidden; }
.hbar__fill { display: block; height: 100%; background: var(--primary); border-radius: 6px; }
.hbar__val { text-align: right; font-size: .85rem; color: var(--text-soft); }

/* ---------- Histogramme vertical ---------- */
.vbars { width: 100%; display: block; }
.vbar__val { font-size: 4px; fill: var(--text-soft); }
.vbar__lbl { font-size: 4px; fill: var(--text-soft); }

/* ---------- Listes diverses ---------- */
.mini-list, .watch-list { list-style: none; margin: 0; padding: 0; }
.mini-list__item { display: grid; grid-template-columns: 70px 1fr auto; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.mini-list__item:last-child { border-bottom: none; }
.mini-list__item:hover { background: #fafbfd; }
.mini-list__id { font-weight: 700; font-size: .85rem; }
.mini-list__main { font-size: .88rem; color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-item { display: flex; align-items: center; gap: .6rem; padding: .45rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.watch-item:last-child { border-bottom: none; }
.watch-dot { width: .6rem; height: .6rem; border-radius: 50%; background: #c0392b; flex-shrink: 0; }
.watch-main { flex: 1; }
.watch-status { font-size: .8rem; color: #c0392b; font-weight: 600; }

/* ---------- Onglets ---------- */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; flex-wrap: wrap; }
.tab { background: none; border: none; padding: .5rem .8rem; cursor: pointer; font-size: .9rem; color: var(--text-soft); border-bottom: 2px solid transparent; }
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }
.tab__count { background: #eef1f5; border-radius: 999px; padding: 0 .4rem; font-size: .75rem; margin-left: .2rem; }

/* ---------- Légende des statuts ---------- */
.status-legend { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.1rem; padding: .8rem 1.1rem; }
.status-legend__title { font-size: .85rem; margin-right: .2rem; }
.status-legend__item { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text-soft); }

/* ---------- Tableaux de données ---------- */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; color: var(--text-soft); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; padding: .5rem .6rem; border-bottom: 2px solid var(--border); white-space: nowrap; }
.data-table td { padding: .6rem .6rem; border-bottom: 1px solid var(--border); }
.data-table tbody tr:hover { background: #fafbfd; }
.row-link { cursor: pointer; }
.row-warn { background: #fdf3f2; }
.row-warn:hover { background: #fbe9e7; }
.result-count { margin: 0 0 .6rem; }

.dot { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; margin-right: .3rem; }
.dot--ok { background: var(--st-resolu); }
.dot--ko { background: #c0392b; }
.pill { background: var(--primary-soft); color: var(--primary-dark); border-radius: 6px; padding: .1rem .45rem; font-size: .8rem; font-weight: 600; }

/* ---------- Barre d'outils (filtres) ---------- */
.toolbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.toolbar input { flex: 1; min-width: 180px; }
.toolbar select { width: auto; min-width: 150px; }

/* ---------- Intervention planifiée ---------- */
.planned-card { display: flex; gap: .9rem; align-items: flex-start; border-left: 4px solid var(--primary); background: var(--primary-soft); }
.planned-card__icon { font-size: 1.6rem; }
.planned-card__date { font-size: 1.1rem; font-weight: 700; color: var(--primary-dark); margin: .2rem 0; }
.planned-card p { margin: .15rem 0; }

/* ---------- Planning ---------- */
.plan-day { margin-bottom: 1.4rem; }
.plan-day__date { font-size: 1rem; margin: 0 0 .6rem; padding-bottom: .3rem; border-bottom: 2px solid var(--border); }
.plan-item { display: block; padding: .7rem .9rem; margin-bottom: .5rem; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 8px; color: var(--text); background: #fafbfd; cursor: pointer; }
.plan-item:hover { text-decoration: none; background: var(--primary-soft); }
.plan-item__head { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.plan-item__note { margin: .4rem 0 0; font-size: .88rem; color: var(--text-soft); }

/* ---------- Agenda / calendrier ---------- */
.plan-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.plan-nav { display: flex; align-items: center; gap: .6rem; }
.plan-nav .btn { padding: .35rem .7rem; }
.plan-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.plan-actions .btn { padding: .4rem .7rem; font-size: .85rem; }
.toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.toggle__btn { background: #fff; border: none; padding: .4rem .8rem; cursor: pointer; font-size: .85rem; color: var(--text-soft); }
.toggle__btn.is-active { background: var(--primary); color: #fff; }
.legend-line { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; font-size: .82rem; margin: .4rem 0 0; }
.carlos-tag { background: #e9e1fb; color: #4a2e9e; font-size: .7rem; font-weight: 700; padding: .05rem .4rem; border-radius: 999px; }
.carlos-tag--btn { border: none; cursor: pointer; line-height: 1.4; }
.carlos-tag--btn:hover { background: #d9ccf7; }
.cal-add-carlos { opacity: 0; background: none; border: 1px dashed #b9a9e8; color: #6a52c4; font-size: .68rem; padding: 0 .3rem; border-radius: 999px; cursor: pointer; transition: opacity .12s; }
.cal-cell:hover .cal-add-carlos { opacity: 1; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-grid--head { margin-bottom: 0; }
.cal-dow { text-align: center; font-size: .78rem; color: var(--text-soft); padding: 4px 0; }
.cal-dow--tue { color: var(--primary); font-weight: 600; }
.cal-cell { min-height: 84px; border: 0.5px solid var(--border); padding: 3px 4px; overflow: hidden; }
.cal-cell--empty { background: #fafbfd; }
.cal-cell--carlos { background: #f3eefc; }
.cal-cell[data-day] { cursor: pointer; }
.cal-cell__head { display: flex; justify-content: space-between; align-items: center; }
.cal-cell__num { font-size: .78rem; color: var(--text-soft); }
.cal-chip { display: flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 2px 4px; border-radius: 4px; margin-top: 3px; line-height: 1.3; color: var(--text); }
.cal-chip.prio--haute { background: #fdecec; color: #7a1f1f; }
.cal-chip.prio--normale { background: #fbeedd; color: #5f3608; }
.cal-chip.prio--basse { background: #e9f3de; color: #2b5210; }
.cal-chip--done { opacity: .55; text-decoration: line-through; }
.cal-chip__txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-resp { font-size: 9.5px; font-weight: 800; background: rgba(0, 0, 0, .1); border-radius: 3px; padding: 0 3px; flex-shrink: 0; }
.chip-done { margin-left: auto; color: var(--st-resolu); font-weight: 700; }
.cal-rem { font-size: 10px; color: #7a5b00; background: #fff7e0; border: 0.5px solid #f0dca0; border-radius: 4px; padding: 2px 4px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more { font-size: 10px; color: var(--text-soft); margin-top: 2px; }
.cal-hint { font-size: .8rem; margin: .6rem 0 0; }

.chips-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.plan-chip { display: inline-flex; align-items: center; gap: .4rem; font-size: .82rem; padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 999px; background: #fafbfd; color: var(--text); }
.plan-chip:hover { text-decoration: none; background: var(--primary-soft); }
.plan-item--done { opacity: .6; }
.plan-item--done strong { text-decoration: line-through; }
.plan-item--rem { background: #fff7e0; border-color: #f0dca0; }
.plan-item--rem .plan-item__head { color: #7a5b00; }
.perso-tag { background: #fdeebc; color: #7a5b00; font-size: .72rem; font-weight: 700; padding: .05rem .45rem; border-radius: 999px; white-space: nowrap; }
.done-tag { color: var(--st-resolu); font-weight: 700; font-size: .8rem; }
.link-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-size: .8rem; padding: 0; text-decoration: underline; }
.reminder-form { border-top: 1px solid var(--border); margin-top: .8rem; padding-top: .8rem; }
.alert--warn { background: #fdf0db; color: #8a5300; border-color: #f0d49a; }
.info-banner { background: #eef6ff; border: 1px solid #b6d9f7; border-left: 4px solid #2563eb; border-radius: 8px; padding: .75rem 1rem; font-size: .88rem; line-height: 1.5; color: #1e3a5f; margin-top: .6rem; }

/* ===================================================================== */
/* Agenda v2 — bandeau priorité, filtre, vues jour/semaine/mois/année    */
/* ===================================================================== */
/* Couleurs par intervenant : LA bleu · BA vert · CA violet              */

/* Bandeau « Ma priorité du jour » */
.agenda-banner { border-left: 4px solid #c0392b; }
.agenda-banner--calm { border-left-color: var(--st-resolu); color: var(--text-soft); }
.agenda-banner__title { font-weight: 700; display: flex; align-items: center; gap: .4rem; margin-bottom: .5rem; }
.agenda-banner__items { display: flex; flex-direction: column; gap: .35rem; }
.agenda-banner__item { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; color: var(--text); padding: .3rem .5rem; border-radius: 6px; }
a.agenda-banner__item:hover { background: var(--primary-soft); text-decoration: none; }
.tag { font-size: .7rem; font-weight: 700; padding: .1rem .45rem; border-radius: 999px; white-space: nowrap; }
.tag--urgent { background: #fdecec; color: #a31515; }
.tag--echeance { background: #fdf0db; color: #8a5300; }

/* Filtre rapide par intervenant */
.filter-chips { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; margin: .2rem 0 .5rem; font-size: .82rem; }
.filter-chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: .25rem .7rem; font-size: .82rem; cursor: pointer; color: var(--text-soft); }
.filter-chip:hover { background: var(--primary-soft); }
.filter-chip.is-active { background: var(--text); color: #fff; border-color: var(--text); }
.filter-chip--la.is-active { background: #1d4e89; border-color: #1d4e89; }
.filter-chip--ba.is-active { background: #2e7d4f; border-color: #2e7d4f; }
.filter-chip--ca.is-active { background: #6d28d9; border-color: #6d28d9; }

/* Pastilles / avatars / badges responsable */
.resp-dot { display: inline-block; width: .7rem; height: .7rem; border-radius: 50%; vertical-align: middle; margin-left: .3rem; }
.resp-dot--la { background: #1d4e89; } .resp-dot--ba { background: #2e7d4f; } .resp-dot--ca { background: #6d28d9; }
.resp-avatar { width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; font-weight: 500; flex-shrink: 0; color: #fff; }
.resp-avatar--la { background: #185FA5; } .resp-avatar--ba { background: #0F6E56; } .resp-avatar--ca { background: #534AB7; }
/* Avatar barre latérale : couleur d'identité de la personne */
.avatar--la { background: #185FA5; } .avatar--ba { background: #0F6E56; } .avatar--ca { background: #534AB7; }
.chip-resp--la { background: #e8f0fa; color: #1d4e89; } .chip-resp--ba { background: #e4f3ea; color: #2e7d4f; } .chip-resp--ca { background: #f0e9fb; color: #6d28d9; }

/* Vue Jour — colonnes par intervenant */
.day-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.day-col { border: 1px solid var(--border); border-radius: 8px; padding: .6rem; background: #fafbfd; min-height: 120px; }
.day-col__head { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--border); }
.day-col__name { font-weight: 700; font-size: .9rem; }
.day-col__role { font-size: .72rem; color: var(--text-soft); }
.day-col__count { margin-left: auto; background: #fff; border: 1px solid var(--border); border-radius: 999px; min-width: 1.4rem; text-align: center; font-size: .78rem; font-weight: 700; padding: .05rem .4rem; }
.day-col__empty { font-size: .82rem; padding: .4rem 0; }
.carlos-day-banner { margin: 0 0 .6rem; }
.day-rems { margin-top: 1rem; }

/* Cartes d'intervention (jour) */
.ev { display: block; background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 6px; padding: .45rem .55rem; margin-bottom: .45rem; color: var(--text); }
.ev:hover { text-decoration: none; background: var(--primary-soft); }
.ev--la { border-left-color: #1d4e89; } .ev--ba { border-left-color: #2e7d4f; } .ev--ca { border-left-color: #6d28d9; }
.ev--done { opacity: .55; }
.ev__head { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.ev__head strong { font-size: .85rem; }
.ev__cat { font-size: .8rem; color: var(--text-soft); margin-top: .15rem; }
.ev__reassign, .ev__note { font-size: .75rem; margin-top: .2rem; }
.ev--mini { padding: .25rem .4rem; margin-bottom: .3rem; display: flex; align-items: center; gap: .3rem; border-left-width: 3px; }
.ev__mini-txt { font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Vue Semaine */
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.week-day { border: 1px solid var(--border); border-radius: 8px; padding: .4rem; min-height: 130px; background: #fff; }
.week-day--carlos { background: #f3eefc; }
.week-day--today { box-shadow: inset 0 0 0 2px var(--primary); }
.week-day__head { display: flex; justify-content: space-between; align-items: center; font-size: .78rem; font-weight: 600; color: var(--text-soft); margin-bottom: .3rem; }
.week-day__empty { color: var(--border); text-align: center; }

/* Vue Mois — chips colorés par intervenant + jour courant */
.cal-chip--la { background: #e8f0fa; color: #163a66; } .cal-chip--ba { background: #e4f3ea; color: #225e3b; } .cal-chip--ca { background: #f0e9fb; color: #561fab; }
.cal-cell--today { box-shadow: inset 0 0 0 2px var(--primary); }

/* Vacances scolaires & jours fériés */
.cal-cell--vac:not(.cal-cell--carlos):not(.cal-cell--today) { background: #f1f2f5; }
.week-day--vac:not(.week-day--carlos):not(.week-day--today) { background: #f1f2f5; }
.cal-ferie { font-size: 10px; color: #791f1f; background: #fcebeb; border: 0.5px solid #f3c2c2; border-radius: 4px; padding: 1px 4px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-context { margin: 0 0 .6rem; padding: .5rem .8rem; border-radius: 8px; font-size: .9rem; font-weight: 500; }
.cal-context--ferie { background: #fcebeb; color: #791f1f; }
.cal-context--vac { background: #f1f2f5; color: var(--text-soft); }
.vac-swatch { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; background: #f1f2f5; border: 0.5px solid var(--border); vertical-align: middle; }

/* Vue Année — 12 mini-mois */
.year-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; }
.year-cell { text-align: left; border: 1px solid var(--border); border-radius: 8px; padding: .6rem; background: #fafbfd; cursor: pointer; min-height: 70px; font: inherit; color: var(--text); }
.year-cell:hover { background: var(--primary-soft); }
.year-cell--cur { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.year-cell__name { font-weight: 700; margin-bottom: .2rem; }
.year-cell__count { font-size: .82rem; }
.year-cell__ech { font-size: .74rem; color: #7a5b00; margin-top: .2rem; }

/* Événements — types : réunion (teal) · projet (rose) · livraison (corail) · échéance (rouge) */
.evt-reunion   { background: #e1f5ee; color: #0f6e56; border-left-color: #1d9e75; }
.evt-projet    { background: #fbeaf0; color: #72243e; border-left-color: #d4537e; }
.evt-livraison { background: #faece7; color: #712b13; border-left-color: #d85a30; }
.evt-echeance  { background: #fcebeb; color: #791f1f; border-left-color: #e24b4a; }

.day-events { display: flex; flex-direction: column; gap: .4rem; margin-bottom: .9rem; }
.evt-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem .65rem; border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: 8px; font-size: .9rem; }
.evt-ic { font-size: 1rem; }
.evt-titre { font-weight: 500; }
.evt-meta { font-size: .78rem; }
.evt-line .link-btn { margin-left: auto; }

.evt-chip { display: flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 2px 4px; border-radius: 4px; margin-top: 3px; line-height: 1.3; }
.evt-chip__txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip__ic { font-size: 10px; flex-shrink: 0; }

.week-events { display: flex; flex-direction: column; gap: 3px; margin-bottom: 5px; }
.week-evt-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.evt-bar { display: flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 7px; border-radius: 4px; overflow: hidden; white-space: nowrap; min-width: 0; }

/* ===================================================================== */
/* Stock technique                                                       */
/* ===================================================================== */
.stock-alert-banner { display: flex; align-items: center; gap: .6rem; border-left: 4px solid #c0392b; color: #791f1f; }
.stock-alert-banner .alert-ic { font-style: normal; font-size: 1.1rem; }
.stock-list { display: flex; flex-direction: column; gap: .8rem; }
.stock-card { display: flex; gap: 1rem; align-items: flex-start; }
.stock-card--alert { border-left: 4px solid #c0392b; }
.stock-photo { width: 64px; height: 64px; flex-shrink: 0; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.stock-photo__emoji { font-size: 1.8rem; line-height: 1; }
.stock-photo__file { font-size: .6rem; color: var(--text-soft); margin-top: 2px; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stock-main { flex: 1; min-width: 0; }
.stock-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; flex-wrap: wrap; }
.stock-nom { font-weight: 700; font-size: .98rem; }
.stock-meta { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .82rem; color: var(--text-soft); margin-top: .4rem; }
.stock-warn { font-size: .85rem; color: #791f1f; margin-top: .35rem; font-weight: 500; }
.stock-note { font-size: .85rem; margin-top: .3rem; }
.stock-actions { display: flex; align-items: center; gap: 1rem; margin-top: .6rem; flex-wrap: wrap; }

.prep-badge { font-size: .72rem; font-weight: 700; padding: .12rem .5rem; border-radius: 999px; white-space: nowrap; }
.prep-todo  { background: #f1efe8; color: #444441; }
.prep-wip   { background: #faeeda; color: #633806; }
.prep-ready { background: #eaf3de; color: #27500a; }
.prep-done  { background: #eef1f5; color: #5b6776; }

.stock-qty { font-size: .92rem; font-weight: 700; white-space: nowrap; }
.stock-qty--ok  { color: #3b6d11; }
.stock-qty--low { color: #791f1f; }
.stock-qty--out { color: #791f1f; }

.pill--la { background: #e8f0fa; color: #163a66; }
.pill--ba { background: #e4f3ea; color: #225e3b; }

.stock-prep-ctrl { font-size: .8rem; color: var(--text-soft); display: flex; align-items: center; gap: .4rem; }
.qty-ctrl { display: inline-flex; align-items: center; gap: .5rem; }
.qty-btn { width: 28px; height: 28px; border: 1px solid var(--border); background: #fff; border-radius: 6px; font-size: 1.1rem; line-height: 1; cursor: pointer; color: var(--text); }
.qty-btn:hover { background: var(--primary-soft); }
.qty-val { min-width: 1.5rem; text-align: center; font-weight: 700; }
.stock-group { margin: 1.4rem .2rem .4rem; font-size: 1rem; }
.stock-list > .stock-group:first-child { margin-top: .2rem; }
.subcat-tag { background: #f1efe8; color: #5f5e5a; border-radius: 6px; padding: .1rem .45rem; font-size: .8rem; }

/* Glisser-déposer */
[data-ticket-id][draggable="true"] { cursor: grab; }
[data-ticket-id].dragging { opacity: .45; }
[data-drop].drop-hover { outline: 2px dashed var(--primary); outline-offset: -3px; background: var(--primary-soft); }

/* Fenêtre de confirmation (modale) */
.modal-overlay { position: fixed; inset: 0; background: rgba(16, 38, 66, .45); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 1rem; }
.modal { background: var(--surface); border-radius: var(--radius); padding: 1.3rem 1.4rem; width: min(430px, 94vw); box-shadow: var(--shadow); }
.modal__title { margin: 0 0 .2rem; font-size: 1.2rem; }
.modal__sub { margin: 0 0 1rem; }
.modal .field { margin-bottom: .7rem; }
.modal__actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.1rem; }
.ev__duree { font-size: .72rem; color: var(--text-soft); }

/* ---------- Impression (fiche de visite) ---------- */
@media print {
  .sidebar, .topbar, .no-print, .back-link { display: none !important; }
  .app-root { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .cal-cell { min-height: 70px; }
}

/* ---------- Détail ticket ---------- */
.detail-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.detail-head h1 { margin: 0; font-size: 1.5rem; }
.staff-panel { background: #fafbfd; }
.staff-row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }

/* ---------- Frise / timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline__item { display: flex; gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.timeline__item:last-child { border-bottom: none; }
.timeline__icon { font-size: 1.1rem; flex-shrink: 0; }
.timeline__detail { margin: 0; }
.timeline__meta { margin: .15rem 0 0; font-size: .8rem; color: var(--text-soft); }

/* ---------- Résultat recherche (suivi) ---------- */
.result-ticket { display: block; margin-top: 1rem; padding: 1rem; color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius); background: #fafbfd; }
.result-ticket:hover { text-decoration: none; background: var(--primary-soft); }
.result-ticket__head { display: flex; justify-content: space-between; align-items: center; }
.result-ticket__meta { font-size: .85rem; color: var(--text-soft); margin: .3rem 0; }
.result-ticket__desc { margin: .3rem 0; }
.link { color: var(--primary); font-weight: 600; }

/* ---------- Divers ---------- */
.empty { text-align: center; padding: 1.5rem; }
.placeholder { text-align: center; max-width: 460px; margin: 2rem auto; }
.placeholder__icon { font-size: 2.5rem; }
.alert { background: #fdecec; color: #a31515; border: 1px solid #f3c2c2; padding: .8rem 1rem; border-radius: 8px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .dash-grid { grid-template-columns: 1fr; }
  .stat-grid, .stat-grid--4 { grid-template-columns: repeat(2, 1fr); }
}
/* ── Badges incidents (page Salles) ───────────────────────────────────── */
.ticket-badge { display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.6rem; height: 1.6rem; border-radius: 50%; font-size: .8rem; font-weight: 700; }
.ticket-badge--ok  { background: #e8f5e9; color: #2e7d32; }
.ticket-badge--warn  { background: #fff3e0; color: #e65100; }
.ticket-badge--alert { background: #ffebee; color: #c62828; }
.ticket-badge--warn a, .ticket-badge--alert a { color: inherit; text-decoration: none; }
.ticket-badge--warn a:hover, .ticket-badge--alert a:hover { text-decoration: underline; }
.td-center { text-align: center; }
.row--has-incident td:first-child strong { color: var(--primary); }

/* --- Vue groupée par zone réseau --- */
.btn-view-toggle {
  padding: .35rem .85rem; border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text-soft); font-size: .85rem;
  cursor: pointer; transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}
.btn-view-toggle:hover { border-color: var(--primary); color: var(--primary); }
.btn-view-toggle--active {
  background: var(--primary-soft); color: var(--primary);
  border-color: var(--primary); font-weight: 600;
}
.topology-wrap { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
.topology-img { display: block; width: 100%; height: auto; }

.zone-group { margin-bottom: 1.5rem; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.zone-header {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  padding: .6rem 1rem; border-bottom: 1px solid var(--border);
}
.zone-header--ok    { background: #f0faf3; }
.zone-header--warn  { background: #fff8ed; }
.zone-header--alert { background: #fff0f0; }
.zone-header__pill {
  display: inline-block; padding: .15rem .55rem; border-radius: 4px;
  font-size: .78rem; font-weight: 700; letter-spacing: .03em;
}
.zone-header__loc { font-size: .85rem; color: var(--text-soft); flex: 1; }
.zone-header__count { font-size: .8rem; color: var(--text-soft); }
.zone-header__tickets { font-size: .82rem; font-weight: 700; padding: .15rem .5rem; border-radius: 4px; }
.zone-tickets--ok   { background: #d6f0dc; color: #1b6b31; }
.zone-tickets--warn { background: #ffe0b2; color: #b84d00; }
/* --- Mon espace — boîtes à outils --- */
.mon-espace { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.toolbox--wide { grid-column: 1 / -1; }
.toolbox {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); align-self: start;
}
.toolbox__header {
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
  padding: .75rem 1rem; cursor: pointer; list-style: none;
  background: var(--primary-soft); user-select: none;
}
.toolbox__header::-webkit-details-marker { display: none; }
.toolbox__header::before { content: "▶"; font-size: .7rem; color: var(--primary); transition: transform .2s; }
details[open] .toolbox__header::before { transform: rotate(90deg); }
.toolbox__icon { font-size: 1.1rem; }
.toolbox__header strong { font-size: 1rem; color: var(--text); }
.toolbox__sub { font-size: .8rem; margin-left: auto; }
.toolbox__body { padding: 1rem; }
.toolbox__section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-soft); margin: 0 0 .4rem; }
.toolbox__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: .75rem; }
.toolbox__list { margin: 0; padding-left: 1.2rem; font-size: .85rem; line-height: 1.7; }
.toolbox__steps { margin: 0; padding-left: 1.4rem; font-size: .85rem; line-height: 1.8; }
.toolbox__note { font-size: .82rem; margin: 0; }

/* Serveur cards */
.srv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; }
.srv-card { border: 1px solid var(--border); border-radius: 8px; padding: .65rem .8rem; background: #fafbfc; }
.srv-card__name { font-weight: 700; font-size: .9rem; margin-bottom: .1rem; color: var(--primary); font-family: monospace; }
.srv-card__roles { font-size: .75rem; color: var(--text-soft); margin-bottom: .5rem; }
.srv-card__dl { display: grid; grid-template-columns: auto 1fr; gap: .15rem .6rem; margin: 0; font-size: .8rem; }
.srv-card__dl dt { font-weight: 600; color: var(--text-soft); white-space: nowrap; }
.srv-card__dl dd { margin: 0; }

/* Placeholder "À compléter" */
.placeholder { color: #b0b8c4; font-style: italic; font-size: .8rem; }

.zone-group .table-wrap { border-radius: 0; box-shadow: none; }
.zone-header--clickable { cursor: pointer; user-select: none; }
.zone-header--clickable:hover { filter: brightness(.97); }
.zone-header__arrow { margin-left: auto; font-size: .75rem; color: var(--text-soft); }

/* Panneau de détail tickets ouvert par zone */
.zone-detail {
  background: #fffaf0; border-bottom: 1px solid var(--border);
  padding: .5rem 1rem;
}
.zone-detail .data-table--compact td, .zone-detail .data-table--compact th {
  padding: .3rem .6rem; font-size: .82rem;
}
.td-mono { font-family: monospace; font-size: .82rem; }

/* Alerte de corrélation */
.corr-alerts { padding: .75rem 1rem 0; }
.corr-alert {
  display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px;
  padding: .6rem .9rem; margin-bottom: .5rem;
}
.corr-alert__icon { font-size: 1.2rem; flex-shrink: 0; }
.corr-alert__body { flex: 1; font-size: .88rem; line-height: 1.4; }
.corr-alert__loc { color: var(--text-soft); }
.corr-alert__link {
  font-size: .82rem; font-weight: 600; color: var(--primary);
  white-space: nowrap; text-decoration: none;
}
.corr-alert__link:hover { text-decoration: underline; }

@media (max-width: 720px) {
  /* Barre latérale en tiroir */
  .topbar__menu { display: block; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: 0 0 30px rgba(0, 0, 0, .3);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 20;
  }
  .home-actions { grid-template-columns: 1fr; }
  .recap { grid-template-columns: 1fr; gap: .15rem; }
  .recap dt { margin-top: .5rem; }
  .app-root { padding: 1rem; }
  .week-grid { grid-template-columns: repeat(2, 1fr); }
  .year-grid { grid-template-columns: repeat(2, 1fr); }
}

/* =====================================================================
   Imprimantes réseau (Mon espace)
   ===================================================================== */
/* Sous-sections imprimantes */
.imp-section { border: 1px solid var(--border); border-radius: 8px; margin-bottom: .5rem; overflow: hidden; }
.imp-section__header {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .9rem; cursor: pointer; list-style: none;
  background: var(--bg); user-select: none; font-size: .9rem;
}
.imp-section__header::-webkit-details-marker { display: none; }
.imp-section__header::before { content: "▶"; font-size: .65rem; color: var(--text-soft); transition: transform .15s; flex-shrink: 0; }
.imp-section[open] > .imp-section__header::before { transform: rotate(90deg); }
.imp-section__header strong { flex: 1; }
.imp-section__icon { font-size: 1.1rem; flex-shrink: 0; }
.imp-section__badge { font-size: .72rem; font-weight: 700; padding: .15em .55em; border-radius: 20px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.imp-section__badge--warn { background: #fee2e2; color: #dc2626; }
.imp-section__body { padding: .75rem; border-top: 1px solid var(--border); background: var(--surface); }

.imp-alerts { display: flex; flex-direction: column; gap: .35rem; }
.imp-alert { font-size: .85rem; padding: .4rem .75rem; border-radius: 6px; }
.imp-alert--error   { background: #fee2e2; color: #991b1b; border-left: 3px solid #dc2626; }
.imp-alert--warn    { background: #fdf0db; color: #92400e; border-left: 3px solid #c2730b; }
.imp-alert--offline { background: #f1f5f9; color: #475569; border-left: 3px solid #94a3b8; }

.imp-ref {
  display: flex; flex-wrap: wrap; gap: .5rem 1.5rem;
  font-size: .82rem; color: var(--text-soft);
  background: var(--bg); border-radius: 6px;
  padding: .5rem .75rem; margin-bottom: .75rem;
}

.imp-table td { vertical-align: middle; }
.imp-ip code { font-size: .82rem; }
.imp-file { font-size: .78rem; color: var(--text-soft); }
.imp-note { font-size: .72rem; background: #fdf0db; color: #c2730b; padding: .1em .4em; border-radius: 4px; margin-left: .3rem; }

.imp-badge { font-size: .75rem; font-weight: 700; padding: .2em .55em; border-radius: 20px; white-space: nowrap; }
.imp-badge--pret     { background: #e4f3ea; color: #15803d; }
.imp-badge--offline  { background: #f1f5f9; color: #475569; }
.imp-badge--erreur   { background: #fee2e2; color: #dc2626; }
.imp-badge--inactive { background: #f8fafc; color: #94a3b8; border: 1px solid var(--border); }

.imp-proc > summary { cursor: pointer; border-radius: 8px; }
/* VLAN explainer */
.vlan-explainer { display: flex; flex-direction: column; gap: .9rem; }
.vlan-block { background: var(--bg); border-radius: 8px; padding: .75rem 1rem; border-left: 3px solid var(--primary); }
.vlan-block h4 { margin: 0 0 .4rem; font-size: .9rem; color: var(--primary); }
.vlan-block p { margin: 0; font-size: .85rem; line-height: 1.55; color: var(--text); }
.vlan-block p + p { margin-top: .4rem; }
.vlan-block--tip { background: var(--primary-soft); border-left-color: var(--primary); font-size: .85rem; line-height: 1.55; }
.vlan-flow { display: flex; align-items: center; gap: .5rem; margin: .6rem 0; flex-wrap: wrap; }
.vlan-step { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: .3em .7em; font-size: .82rem; font-weight: 600; }
.vlan-step--server { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.vlan-arrow { color: var(--text-soft); font-size: 1rem; }

.imp-live { font-size: .8rem; font-weight: 600; }
.imp-live--on  { color: #15803d; }
.imp-live--off { color: #94a3b8; }

/* =====================================================================
   Kit de rentrée scolaire
   ===================================================================== */
.kr-wrap { max-width: 860px; }

/* En-tête */
.kr-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .75rem; margin-bottom: 1.25rem;
}
.kr-header__left { display: flex; align-items: baseline; gap: .75rem; }
.kr-title { margin: 0; font-size: 1.35rem; }
.kr-annee {
  font-size: .8rem; font-weight: 600; padding: .2em .6em;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 20px;
}
.kr-reset-btn {
  font-size: .8rem; padding: .4em .9em; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  transition: background .15s;
}
.kr-reset-btn:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

/* Barre de progression globale */
.kr-progress-global { margin-bottom: 1.25rem; }
.kr-progress-global__label {
  display: flex; justify-content: space-between;
  font-size: .85rem; margin-bottom: .35rem; color: var(--text-soft);
}
.kr-bar {
  height: 10px; background: var(--border); border-radius: 99px; overflow: hidden;
}
.kr-bar__fill {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .4s ease;
}

/* Onglets de phase */
.kr-tabs {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem;
  margin-bottom: 1.25rem;
}
.kr-tab {
  display: flex; flex-direction: column; gap: .15rem;
  padding: .75rem 1rem; border-radius: var(--radius);
  border: 2px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left; transition: border-color .15s, box-shadow .15s;
}
.kr-tab:hover { border-color: var(--ph-color, var(--primary)); }
.kr-tab--active {
  border-color: var(--ph-color, var(--primary));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ph-color, var(--primary)) 15%, transparent);
}
.kr-tab__icon { font-size: 1.3rem; }
.kr-tab__label { font-weight: 700; font-size: .95rem; color: var(--text); }
.kr-tab__sub { font-size: .75rem; color: var(--text-soft); }
.kr-tab__badge {
  font-size: .75rem; font-weight: 600;
  color: var(--ph-color, var(--primary));
}
.kr-tab__bar {
  height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; margin-top: .25rem;
}
.kr-tab__bar-fill {
  height: 100%; background: var(--ph-color, var(--primary)); border-radius: 99px;
  transition: width .4s ease;
}

/* Sections */
.kr-section { margin-bottom: .75rem; }
.kr-section--done > summary .toolbox__icon::after { content: " ✅"; }
.kr-responsable {
  font-size: .75rem; background: #fdf0db; color: #c2730b;
  padding: .15em .5em; border-radius: 20px; font-weight: 600; margin-left: auto;
}
.kr-section__badge {
  font-size: .75rem; font-weight: 700; color: var(--text-soft);
  margin-left: .5rem;
}
.kr-section__badge--done { color: #15803d; }

/* Mini barre dans summary */
.kr-mini-bar {
  width: 60px; height: 4px; background: var(--border); border-radius: 99px;
  overflow: hidden; margin-left: .5rem; flex-shrink: 0;
}
.kr-mini-bar__fill {
  height: 100%; background: var(--primary); border-radius: 99px;
  transition: width .4s ease;
}

/* Checklist */
.kr-checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .4rem; }
.kr-item {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .5rem .6rem; border-radius: 6px; border: 1px solid var(--border);
  background: var(--bg); transition: background .15s, opacity .15s;
}
.kr-item--done { opacity: .55; }
.kr-item--done .kr-item__text { text-decoration: line-through; }
.kr-item__label { display: flex; align-items: center; gap: .6rem; cursor: pointer; flex: 1; }
.kr-check { width: 16px; height: 16px; flex-shrink: 0; accent-color: var(--primary); cursor: pointer; }
.kr-item__text { font-size: .9rem; }
.kr-badge {
  font-size: .7rem; font-weight: 700; padding: .15em .55em;
  border-radius: 20px; white-space: nowrap; flex-shrink: 0;
}

/* Bouton procédure */
.kr-proc-btn {
  margin-top: .75rem; padding: .45em 1em; border-radius: 6px; font-size: .85rem;
  cursor: pointer; border: none; background: var(--primary); color: #fff; font-weight: 600;
  transition: background .15s;
}
.kr-proc-btn:hover { background: var(--primary-dark); }
.kr-proc-btn--disabled {
  background: var(--border); color: var(--text-soft); cursor: not-allowed;
}

/* Contacts */
.kr-contacts-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .75rem;
}
.kr-contact-card {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .65rem .8rem; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg); font-size: .85rem;
}
.kr-contact-card strong { color: var(--text); }

/* Hint critères */
.kr-salles-hint {
  font-size: .82rem; color: var(--text-soft);
  background: var(--primary-soft); border-radius: 6px;
  padding: .45rem .75rem; margin: 0 0 .75rem;
}
.kr-salles-hint em { color: var(--primary); font-style: normal; font-weight: 600; }

/* Sous-zones de salles */
.kr-subzone {
  border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: .5rem; overflow: hidden;
}
.kr-subzone--done { opacity: .7; }
.kr-subzone__header {
  display: flex; align-items: center; gap: .6rem;
  padding: .55rem .75rem; cursor: pointer;
  background: var(--bg); list-style: none; font-size: .9rem;
  user-select: none;
}
.kr-subzone__header::-webkit-details-marker { display: none; }
.kr-subzone__header::before {
  content: "▶"; font-size: .65rem; color: var(--text-soft);
  transition: transform .15s; flex-shrink: 0;
}
.kr-subzone[open] > .kr-subzone__header::before { transform: rotate(90deg); }
.kr-subzone__label { font-weight: 600; flex: 1; }
.kr-subzone__count { font-size: .75rem; font-weight: 700; color: var(--text-soft); }
.kr-subzone__count--done { color: #15803d; }

/* Checklist salles */
.kr-checklist--rooms { padding: .5rem .75rem .75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem; }
.kr-item__room { display: flex; flex-direction: column; gap: .05rem; flex: 1; }
.kr-item__room strong { font-size: .9rem; }
.kr-item__type { font-size: .72rem; color: var(--text-soft); }
.kr-item__criteres { font-size: .7rem; color: var(--text-soft); font-style: italic; }

/* Responsive */
@media (max-width: 600px) {
  .kr-tabs { grid-template-columns: 1fr; }
  .kr-item { flex-wrap: wrap; }
  .kr-checklist--rooms { grid-template-columns: 1fr; }
}
