/* Gestion de l'internat — feuille de style
   Direction : back-office dense et lisible. Le plan des lits est l'élément central ;
   tout le reste reste sobre. Les états ne reposent jamais sur la couleur seule. */

:root {
  /* Couleurs IFSM : fond blanc, bleu marine, touches de rouge */
  --paper: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f6fb;
  --line: #e2e4ef;
  --line-strong: #c9cce0;
  --ink: #1a1c3a;
  --ink-2: #3a3d5c;
  --muted: #5f6280;

  --navy: #2e3192;             /* bleu marine IFSM */
  --navy-dark: #23266f;
  --navy-deep: #1c1f5c;
  --red: #e31e24;              /* rouge IFSM, utilisé avec parcimonie */
  --red-dark: #c4161c;

  --primary: var(--navy);
  --primary-hover: var(--navy-dark);
  --primary-soft: #eceefa;
  --on-primary: #ffffff;
  --ext-bg: #e4e6f7;           /* externes : marine clair */
  --ext-ink: var(--navy-deep);

  --success: #1d7a4a;
  --success-soft: #e5f4ec;
  --warning: #8f5b00;
  --warning-soft: #fdf2d8;
  --danger: var(--red-dark);
  --danger-soft: #fdeceb;
  --info: var(--navy);
  --info-soft: #eceefa;

  --sidebar: var(--navy);
  --sidebar-ink: #d9dbf3;
  --focus: #4a55d6;

  --radius-sm: 6px;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(28, 31, 92, .06);
  --ease: cubic-bezier(.2, .7, .3, 1);

  --font: "Fira Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 15px; line-height: 1.5;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3 { margin: 0 0 .6rem; line-height: 1.25; font-weight: 600; letter-spacing: -.005em; }
h2 { font-size: 1.08rem; }
h3 { font-size: .98rem; }
p { margin: 0 0 .6rem; }
small, .muted { color: var(--muted); }
code { font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 50; background: var(--surface); color: var(--ink);
  padding: .5rem .9rem; border-radius: var(--radius-sm); box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
.skip-link:focus { top: 1rem; }

/* ---------- Structure ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--sidebar); color: var(--sidebar-ink);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: .7rem; align-items: center; padding: 1.1rem 1rem 1rem; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: .3rem; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px; background: #fff; object-fit: contain; padding: 2px; }
.brand strong { display: block; color: #fff; font-size: .98rem; }
.brand small { color: #b9bce6; font-size: .8rem; display: block; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar nav { flex: 1; padding: .4rem .55rem; overflow-y: auto; }
.nav-group { font-size: .76rem; color: #a7abe0; padding: .9rem .6rem .3rem; }
.sidebar nav a {
  display: flex; align-items: center; gap: .65rem; min-height: 38px; padding: .45rem .6rem; border-radius: var(--radius-sm);
  color: var(--sidebar-ink); text-decoration: none; font-size: .92rem; transition: background .15s var(--ease), color .15s var(--ease);
}
.sidebar nav a:hover { background: rgba(255,255,255,.09); color: #fff; }
.sidebar nav a[aria-current="page"] { background: #fff; color: var(--navy); font-weight: 600; box-shadow: inset 4px 0 0 var(--red); }
.sidebar svg { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-user { padding: .9rem 1rem; border-top: 1px solid rgba(255,255,255,.15); display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.sidebar-user strong { display: block; color: #fff; font-size: .88rem; font-weight: 500; }
.sidebar-user small { color: #b9bce6; font-size: .78rem; }
.sidebar .btn-ghost { color: #fff; border-color: rgba(255,255,255,.35); background: transparent; }
.sidebar .btn-ghost:hover { background: rgba(255,255,255,.12); color: #fff; }
.scrim { display: none; }

.main { flex: 1; min-width: 0; }
.topbar {
  border-top: 3px solid var(--red);
  display: flex; align-items: center; gap: .9rem; padding: .8rem 1.5rem; min-height: 60px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 1.2rem; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle {
  display: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  width: 44px; height: 44px; border-radius: var(--radius-sm); cursor: pointer; place-items: center;
}
.menu-toggle svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.content { padding: 1.4rem 1.5rem 3rem; max-width: 1440px; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1.1rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem 1rem; margin-bottom: .9rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head p { margin: .15rem 0 0; }
.card.flush { padding: 0; }
.card.flush > .card-head { padding: 1rem 1.2rem 0; }
.card.flush > .table-wrap { border-top: 1px solid var(--line); }
.grid { display: grid; gap: 1.1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* Bandeau d'indicateurs : une seule surface découpée, pas une rangée de cartes identiques */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 1.1rem; overflow: hidden;
}
.stat { padding: .95rem 1.15rem; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 0 -1px -1px 0; }
.stat .label { color: var(--muted); font-size: .84rem; }
.stat .value { font-size: 1.45rem; font-weight: 600; margin-top: .1rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.25; }
.stat .value.text { font-size: 1.05rem; }
.stat .sub { font-size: .82rem; color: var(--muted); margin-top: .15rem; }
.stat.danger .value { color: var(--danger); }
.stat.success .value { color: var(--success); }

.chip { background: var(--primary-soft); color: var(--primary); padding: .2rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .5rem; border-radius: 99px;
  font-size: .76rem; font-weight: 500; white-space: nowrap; line-height: 1.5; vertical-align: 1px;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-accent { background: var(--ext-bg); color: var(--ext-ink); border: 1px solid var(--line-strong); }
.badge-muted { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

.alert {
  display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: var(--radius-sm);
  margin-bottom: 1rem; border: 1px solid transparent; border-left-width: 4px; font-size: .92rem;
}
.alert::before { font-weight: 700; flex-shrink: 0; width: 1.1rem; text-align: center; }
.alert-success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.alert-success::before { content: "✓"; }
.alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.alert-error::before, .alert-danger::before { content: "!"; }
.alert-info { background: var(--info-soft); color: var(--info); border-color: var(--info); }
.alert-info::before { content: "i"; font-style: italic; font-family: Georgia, serif; }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: var(--warning); }
.alert-warning::before { content: "!"; }
.alert a { color: inherit; font-weight: 600; }
.alert > div, .alert > span { flex: 1; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 38px;
  padding: .45rem .9rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: var(--primary); color: var(--on-primary); font: inherit; font-size: .9rem; font-weight: 500;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { min-height: 32px; padding: .25rem .65rem; font-size: .84rem; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); border-color: var(--muted); }
.btn-accent { background: var(--red); color: #fff; }
.btn-accent:hover { background: var(--red-dark); color: #fff; }
.btn-danger { background: var(--surface); color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.actions { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* ---------- Formulaires ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .85rem 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { margin: 1.3rem 0 .7rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .95rem; }
.form-section:first-of-type { margin-top: .4rem; padding-top: 0; border-top: 0; }
label { display: block; font-size: .86rem; font-weight: 500; margin-bottom: .3rem; color: var(--ink-2); }
label.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; color: var(--ink); cursor: pointer; min-height: 32px; }
input, select, textarea {
  width: 100%; min-height: 38px; padding: .45rem .65rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  font: inherit; font-size: .93rem; background: var(--surface); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { min-height: 70px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; min-height: 0; accent-color: var(--primary); cursor: pointer; }
.form-actions { display: flex; gap: .6rem; margin-top: 1.1rem; flex-wrap: wrap; }
.filters { display: flex; gap: .6rem; flex-wrap: wrap; align-items: flex-end; margin-bottom: 1rem; }
.filters > div { min-width: 150px; }
.filters .grow { flex: 1; min-width: 220px; }
.hint { font-size: .82rem; color: var(--muted); margin: .3rem 0 0; }
.req { color: var(--danger); }

details.panel { margin-bottom: 1.1rem; }
details.panel > summary { list-style: none; cursor: pointer; display: inline-flex; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel[open] > summary { margin-bottom: .9rem; }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th {
  text-align: left; font-size: .8rem; color: var(--muted); font-weight: 500; padding: .55rem .7rem;
  border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; position: sticky; top: 0;
}
td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s var(--ease); }
tbody tr:hover { background: var(--surface-2); }
tfoot td { font-weight: 600; background: var(--surface-2); border-top: 1px solid var(--line-strong); border-bottom: 0; }
td.empty, .empty { text-align: center; color: var(--muted); padding: 2rem 1rem; }
.who { display: flex; align-items: center; gap: .6rem; }
.who strong { font-weight: 500; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0;
  font-size: .76rem; font-weight: 600; background: var(--primary-soft); color: var(--primary);
}
.avatar.ext { background: #fff; color: var(--navy); border: 1.5px solid var(--navy); }
.overdue { color: var(--danger); font-weight: 500; }
.overdue::after { content: " · en retard"; font-size: .78rem; font-weight: 400; }
.amount-due { color: var(--danger); font-weight: 500; }

/* ---------- Occupation ---------- */
.occ { display: flex; align-items: center; gap: .6rem; }
.occ-bar { flex: 1; height: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 99px; overflow: hidden; min-width: 80px; }
.occ-bar span { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.occ-bar .high { background: var(--warning); }
.occ-bar .full { background: var(--danger); }
.occ-txt { font-size: .82rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }

.internat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.internat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .75rem; }
.internat-card h3 { margin: 0; font-size: 1.05rem; }
.internat-card h3 a { color: var(--ink); text-decoration: none; }
.internat-card h3 a:hover { color: var(--primary); text-decoration: underline; }
.internat-card .meta { display: flex; gap: .35rem .9rem; flex-wrap: wrap; font-size: .84rem; color: var(--muted); }
.internat-card .figures { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; border-top: 1px solid var(--line); padding-top: .7rem; }
.internat-card .figures strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.internat-card .figures span { font-size: .78rem; color: var(--muted); }

/* ---------- Plan des chambres : l'élément signature ---------- */
.plan-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.legend { display: flex; gap: .4rem 1.1rem; font-size: .84rem; color: var(--muted); flex-wrap: wrap; align-items: center; }
.legend .bed-mini { display: inline-block; width: 22px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: .35rem; }
.floor { margin-bottom: 1.4rem; }
.floor-title { font-size: .9rem; color: var(--muted); font-weight: 500; margin: 0 0 .6rem; display: flex; gap: .5rem; align-items: baseline; }
.floor-title strong { color: var(--ink); font-weight: 600; }
.rooms { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: .8rem; }
.room { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: .75rem .8rem .8rem; display: flex; flex-direction: column; gap: .55rem; }
.room.is-full { border-color: var(--line-strong); }
.room.maintenance { background: repeating-linear-gradient(-45deg, var(--warning-soft) 0 10px, var(--surface) 10px 20px); }
.room.fermee { background: var(--surface-2); }
.room.fermee .beds { opacity: .5; }
.room-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.room-no { font-size: 1.1rem; font-weight: 600; letter-spacing: -.01em; }
.room-no small { font-size: .8rem; font-weight: 400; margin-left: .3rem; }
.room-count { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.room-tarif { font-size: .8rem; color: var(--muted); display: flex; gap: .8rem; }
.room-tarif b { color: var(--ink-2); font-weight: 500; }
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: .4rem; }
.bed {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-height: 58px;
  border-radius: 7px; padding: .35rem .5rem .4rem 1.15rem; text-decoration: none; font-size: .8rem; line-height: 1.25;
  border: 1px solid transparent; transition: transform .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
/* l'oreiller du lit, à gauche */
.bed::before { content: ""; position: absolute; left: .35rem; top: .4rem; bottom: .4rem; width: 5px; border-radius: 3px; background: currentColor; opacity: .55; }
.bed .bed-no { font-size: .72rem; opacity: .85; }
.bed .bed-who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bed.taken { background: var(--primary); color: var(--on-primary); }
.bed.taken.ext { background: var(--ext-bg); color: var(--ext-ink); border: 1.5px solid var(--navy); }
.bed.free { background: var(--surface); color: var(--success); border: 1.5px dashed color-mix(in srgb, var(--success) 55%, transparent); }
.bed.free .bed-who { font-weight: 500; }
a.bed:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(24, 33, 43, .14); }
a.bed.free:hover { background: var(--success-soft); }
a.bed.taken:hover { color: var(--on-primary); }
a.bed.taken.ext:hover { color: var(--ext-ink); }
.bed.off { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.room-actions { display: flex; gap: .4rem; margin-top: auto; padding-top: .2rem; }

.bars { display: flex; flex-direction: column; gap: .8rem; }
.bars .row { display: grid; grid-template-columns: minmax(150px, 1fr) 1.6fr; gap: .9rem; align-items: center; font-size: .9rem; }
.bars .row a { font-weight: 500; text-decoration: none; color: var(--ink); }
.bars .row a:hover { color: var(--primary); text-decoration: underline; }

.dl { display: grid; grid-template-columns: 140px 1fr; gap: .45rem 1rem; font-size: .92rem; margin: 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

.trend { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.trend span { display: block; height: 6px; border-radius: 3px; }

/* ---------- Authentification ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1rem; background: var(--navy); background-image: linear-gradient(var(--red), var(--red)); background-size: 100% 6px; background-repeat: no-repeat; }
.auth-card { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 2rem; border-top: 4px solid var(--red); width: 100%; max-width: 410px; box-shadow: 0 24px 60px rgba(0,0,0,.35); }
.auth-card h1 { font-size: 1.3rem; }
.auth-card .form-grid { grid-template-columns: 1fr; }
.auth-card .btn { width: 100%; margin-top: .3rem; min-height: 44px; }
.auth-brand { display: flex; gap: .75rem; align-items: center; margin-bottom: 1.3rem; }
.auth-brand strong { display: block; font-size: 1.05rem; }

/* ---------- Reçu ---------- */
.receipt { max-width: 720px; margin: 0 auto; }
.receipt-head { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 2px solid var(--navy); padding-bottom: .8rem; margin-bottom: 1rem; }
.receipt-total { font-size: 1.3rem; font-weight: 600; text-align: right; margin-top: 1rem; }
.signatures { display: flex; justify-content: space-between; margin-top: 3.5rem; font-size: .9rem; }
.stamp { border: 2px solid var(--danger); color: var(--danger); display: inline-block; padding: .2rem .7rem; font-weight: 700; transform: rotate(-4deg); }

@media print {
  :root { color-scheme: light; }
  .sidebar, .topbar, .no-print, .alert, .skip-link { display: none !important; }
  body, .main { background: #fff; color: #000; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  a.bed:hover { transform: none; }
}

@media (max-width: 960px) {
  .grid-2, .grid-3, .grid-wide { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s var(--ease); }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar.open + .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 16, 24, .45); z-index: 25; }
  .menu-toggle { display: grid; }
  .content { padding: 1rem; }
  .topbar { padding: .6rem 1rem; }
  .bars .row { grid-template-columns: 1fr; gap: .3rem; }
  .dl { grid-template-columns: 1fr; gap: .1rem; }
  .dl dd { margin-bottom: .5rem; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 40px; }
  .sidebar nav a { min-height: 44px; }
  .filters > div { flex: 1 1 140px; }
}

/* Tableaux pleine largeur dans une carte : aligner sur la marge de la carte */
.card.flush th:first-child, .card.flush td:first-child { padding-left: 1.2rem; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 1.2rem; }

input[readonly] { background: var(--surface-2); color: var(--muted); cursor: default; }
input[readonly]:focus { box-shadow: none; border-color: var(--line-strong); }

/* ---------- Onglets des campus ---------- */
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.tabs a {
  flex: 0 1 260px; padding: .55rem .9rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 500; transition: border-color .15s var(--ease);
}
.tabs a:hover { border-color: var(--line-strong); color: var(--ink); }
.tabs a small { display: block; font-weight: 400; font-size: .8rem; }
.tabs a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tabs a[aria-current="page"] small { color: var(--sidebar-ink); }

/* ---------- Tarifs ---------- */
.rules { margin: 0; padding-left: 1.1rem; }
.rules li { margin-bottom: .25rem; }
table.tarifs th.groupe { text-align: center; color: var(--ink); font-weight: 600; border-left: 1px solid var(--line); }
table.tarifs tbody th { background: none; color: var(--ink); font-size: .9rem; font-weight: 500; position: static; }
table.tarifs input { min-width: 104px; text-align: right; }
fieldset.formules { border: 0; padding: 0; margin: 0; }
fieldset.formules legend { padding: 0; margin-bottom: .3rem; font-size: .85rem; font-weight: 500; }
fieldset.formules .check { display: inline-flex; margin-right: 1.2rem; }

/* ---------- Page de présentation ---------- */
.public { max-width: 980px; margin: 0 auto; padding: 0 1rem 3rem; }
.public-top { display: flex; align-items: center; gap: .8rem; padding: 1rem 0; border-bottom: 3px solid var(--red); margin-bottom: 2rem; }
.public-top img { width: 48px; height: 48px; object-fit: contain; }
.public-top strong { flex: 1; font-size: 1.05rem; color: var(--navy); }
.public-hero { margin-bottom: 2rem; }
.public-hero h1 { font-size: clamp(1.7rem, 5vw, 2.5rem); color: var(--navy); margin-bottom: .5rem; }
.public-hero p { font-size: 1.05rem; color: var(--ink-2); max-width: 62ch; }
.atouts { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.public section { margin-bottom: 1.5rem; }
.public h2 { font-size: 1.25rem; color: var(--navy); }
.public-contact { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.public-contact h2 { color: #fff; }
.telephones { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: 0; font-size: 1.05rem; font-weight: 500; }
.telephones span { white-space: nowrap; }
@media (max-width: 480px) {
  .public th, .public td { padding: .5rem .35rem; font-size: .8rem; }
  .public td:first-child { white-space: nowrap; }
}
