/* HostLite — design system (compilé à la main, aucun build requis) */
:root {
  --hl-primary: #1f6f5c;
  --hl-primary-dark: #175647;
  --hl-accent: #e8b04b;
  --hl-bg: #f6f7f5;
  --hl-surface: #ffffff;
  --hl-text: #1d2723;
  --hl-muted: #64716b;
  --hl-border: #dfe5e1;
  --hl-danger: #b3372f;
  --hl-warning: #a06a10;
  --hl-success: #23744f;
  --hl-info: #2a5d8f;
  --hl-radius: 10px;
  --hl-shadow: 0 1px 3px rgba(29, 39, 35, .08), 0 4px 16px rgba(29, 39, 35, .05);
  --hl-font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--hl-font); font-size: 15px; line-height: 1.55;
  color: var(--hl-text); background: var(--hl-bg);
}
a { color: var(--hl-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .6em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
img { max-width: 100%; }

/* Layout application */
.hl-shell { display: flex; min-height: 100vh; }
.hl-sidebar {
  width: 230px; flex-shrink: 0; background: #142a23; color: #dbe7e2;
  display: flex; flex-direction: column; padding: 0;
  /* À la hauteur de l'écran, quelle que soit la longueur de la page : le menu défile à l'intérieur et
     le sélecteur d'organisation, en bas, reste toujours visible. */
  position: sticky; top: 0; align-self: flex-start; height: 100vh; height: 100dvh;
}
.hl-brand {
  display: flex; align-items: center; gap: .55rem; padding: 1rem 1.1rem;
  font-weight: 700; font-size: 1.05rem; color: #fff; letter-spacing: .3px;
}
.hl-brand-mark {
  width: 26px; height: 26px; border-radius: 7px; background: var(--hl-accent);
  display: inline-flex; align-items: center; justify-content: center;
  color: #142a23; font-weight: 800; font-size: .9rem;
}
.hl-nav { flex: 1; overflow-y: auto; padding: .4rem .6rem 1rem; }
.hl-nav-group { margin: .9rem .5rem .3rem; font-size: .68rem; text-transform: uppercase;
  letter-spacing: .8px; color: #7f958c; }
.hl-nav a {
  display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem;
  border-radius: 8px; color: #dbe7e2; font-size: .9rem;
}
.hl-nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
/* Groupes secondaires du menu : repliés, dépliés d'un clic. */
.hl-nav-more > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: .4rem; border-radius: 6px; padding: .25rem .4rem; margin-left: .1rem; margin-right: .1rem; }
.hl-nav-more > summary::-webkit-details-marker { display: none; }
.hl-nav-more > summary::after { content: '▸'; font-size: .7rem; opacity: .7; }
.hl-nav-more[open] > summary::after { content: '▾'; }
.hl-nav-more > summary:hover { background: rgba(255,255,255,.07); color: #dbe7e2; }
.hl-nav-count { margin-left: auto; font-size: .62rem; opacity: .6; letter-spacing: 0; }
.hl-nav a.active { background: var(--hl-primary); color: #fff; }
.hl-orgswitch { padding: .8rem 1rem; border-top: 1px solid rgba(255,255,255,.09); font-size: .85rem; }
.hl-orgswitch select { width: 100%; }
.hl-topbar-org { display: flex; align-items: center; gap: .4rem; margin: 0; font-size: .85rem; color: var(--hl-muted); }
.hl-topbar-org select { width: auto; max-width: 16rem; padding: .25rem .5rem; font-size: .85rem; }
@media (max-width: 640px) { .hl-topbar-org label { display: none; } .hl-topbar-org select { max-width: 9rem; } }
@media print { .hl-topbar-org { display: none; } }
.hl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hl-topbar {
  display: flex; align-items: center; gap: 1rem; padding: .7rem 1.3rem;
  background: var(--hl-surface); border-bottom: 1px solid var(--hl-border);
}
.hl-topbar .spacer { flex: 1; }
.hl-burger { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; color: var(--hl-text); }
.hl-content { padding: 1.3rem; max-width: 1200px; width: 100%; }

/* Cartes, tableaux, formulaires */
.card {
  background: var(--hl-surface); border: 1px solid var(--hl-border);
  border-radius: var(--hl-radius); box-shadow: var(--hl-shadow);
  padding: 1.1rem 1.2rem; margin-bottom: 1.1rem;
}
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.grid { display: grid; gap: 1rem; }
@media (min-width: 760px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
  .grid-5 { grid-template-columns: repeat(5, 1fr); }
}
.stat { padding: .9rem 1rem; }
.stat .label { font-size: .75rem; color: var(--hl-muted); text-transform: uppercase; letter-spacing: .5px; }
.stat .value { font-size: 1.5rem; font-weight: 700; margin-top: .15rem; }

.table-wrap { overflow-x: auto; }
table.hl { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.hl th, table.hl td { text-align: left; padding: .55rem .65rem; border-bottom: 1px solid var(--hl-border); }
table.hl th { font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; color: var(--hl-muted); }
table.hl tr:hover td { background: #fafbf9; }

label { display: block; font-weight: 600; font-size: .84rem; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=url], select, textarea {
  width: 100%; padding: .5rem .65rem; border: 1px solid var(--hl-border);
  border-radius: 8px; font: inherit; background: #fff; color: var(--hl-text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--hl-primary) 35%, transparent);
  border-color: var(--hl-primary);
}
.field { margin-bottom: .9rem; }
.hint { font-size: .78rem; color: var(--hl-muted); margin-top: .2rem; }
.error-text { color: var(--hl-danger); font-size: .8rem; margin-top: .2rem; }
.checkbox { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
.checkbox input { width: auto; margin-top: .25rem; }

.btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .5rem .95rem;
  border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600;
  cursor: pointer; background: var(--hl-primary); color: #fff; font-size: .9rem;
}
.btn:hover { background: var(--hl-primary-dark); text-decoration: none; }
.btn.secondary { background: #fff; color: var(--hl-text); border-color: var(--hl-border); }
.btn.secondary:hover { background: #f2f4f1; }
.btn.danger { background: var(--hl-danger); }
.btn.small { padding: .3rem .6rem; font-size: .8rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

.badge {
  display: inline-block; padding: .12rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; letter-spacing: .3px;
  background: #e8ece9; color: var(--hl-muted);
}
.badge.green { background: #ddefe6; color: var(--hl-success); }
.badge.red { background: #f7e1df; color: var(--hl-danger); }
.badge.amber { background: #f7ecd7; color: var(--hl-warning); }
.badge.blue { background: #dfeaf5; color: var(--hl-info); }

.alert { padding: .7rem .95rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; }
.alert.success { background: #ddefe6; color: var(--hl-success); }
.alert.error { background: #f7e1df; color: var(--hl-danger); }
.alert.info { background: #dfeaf5; color: var(--hl-info); }

/* Layout invité (login, installation) */
.hl-guest {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 1.2rem; background: linear-gradient(160deg, #142a23 0%, #1f6f5c 100%);
}
.hl-guest-card {
  width: 100%; max-width: 430px; background: var(--hl-surface);
  border-radius: 14px; box-shadow: 0 8px 40px rgba(0,0,0,.25); padding: 1.6rem 1.7rem;
}
.hl-guest-card.wide { max-width: 640px; }
.hl-guest-logo { text-align: center; margin-bottom: 1.1rem; font-weight: 800; font-size: 1.3rem; color: var(--hl-primary-dark); }

/* Calendrier */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; font-size: .78rem; }
.cal .head { text-align: center; color: var(--hl-muted); padding: .2rem 0; font-weight: 600; }
.cal .day {
  min-height: 58px; background: #fff; border: 1px solid var(--hl-border);
  border-radius: 6px; padding: .25rem .3rem; position: relative;
}
.cal .day.out { opacity: .35; }
.cal .day .n { font-weight: 600; }
/* Le jour J : case teintée, bord vert et numéro en pastille — on se repère d'un coup d'œil. */
.cal .day.today { background: #edf6f1; border-color: var(--hl-primary); }
.cal .day.today .n { display: inline-block; min-width: 1.5rem; padding: 0 .35rem; border-radius: 999px; background: var(--hl-primary); color: #fff; text-align: center; }
.cal .day .price { display: block; color: var(--hl-muted); font-size: .7rem; }
.cal .day.occ-BOOKING { background: #ddefe6; border-color: #9fceb6; }
.cal .day.occ-HOLD { background: #f7ecd7; border-color: #e0c48b; }
.cal .day.occ-BLOCK { background: #e8ece9; border-color: #c4ccc7; }
.cal .day.occ-MAINTENANCE { background: #f2e2f5; border-color: #cfa4d8; }
.cal .day.occ-ICAL { background: #dfeaf5; border-color: #9fbedb; }
/* Périodes d'une politique séjour minimum / prix : liseré en haut de la case */
.cal .day.per-low_weekend { box-shadow: inset 0 3px 0 #cfd9d4; }
.cal .day.per-high_weekday, .cal .day.per-high_weekend, .per-dot.per-high { box-shadow: inset 0 3px 0 #e8b04b; }
.cal .day.per-event, .per-dot.per-event { box-shadow: inset 0 3px 0 #d9534f; }
.per-dot { display: inline-block; width: .8rem; height: .45rem; border-radius: 2px; margin-right: .35rem; vertical-align: middle; background: #f3f6f4; }
.per-dot.per-high { background: #e8b04b; box-shadow: none; }
.per-dot.per-event { background: #d9534f; box-shadow: none; }
.cal .day.closed { background: repeating-linear-gradient(45deg, #fff, #fff 4px, #f2f2f2 4px, #f2f2f2 8px); }

/* Séjours, à la manière d'Airbnb : une barre continue de l'après-midi de l'arrivée au matin du départ. Chaque case a
   deux moitiés (gauche = nuit d'avant, droite = nuit du jour) ; entre deux cases, la barre franchit l'écart de 2 px.
   En bord de semaine (lundi, dimanche), elle s'arrête au bord de la case pour ne pas sortir du calendrier. */
.cal .day .stay { position: absolute; bottom: .22rem; height: 1.2rem; z-index: 1; background: #c9d1cc; }
.cal .day .stay-l { left: -2px; right: 50%; }
.cal .day .stay-r { left: 50%; right: -2px; }
.cal .day .stay-r.start { left: calc(50% + 2px); border-top-left-radius: 999px; border-bottom-left-radius: 999px; }
.cal .day .stay-l.end { right: calc(50% + 2px); border-top-right-radius: 999px; border-bottom-right-radius: 999px; }
.cal .day:nth-child(7n+1) .stay-l { left: 0; }
.cal .day:nth-child(7n) .stay-r { right: 0; }
.cal .day .stay-BOOKING { background: #9fceb6; }
.cal .day .stay-HOLD { background: #e5c98f; }
.cal .day .stay-ICAL { background: #a6c3de; }
.cal .day .stay-MAINTENANCE { background: #d6aede; }
.cal .day .stay-BLOCK, .cal .day .stay-LEASE { background: #c9d1cc; }
.cal .day .stay-label {
  position: absolute; left: calc(50% + .45rem); bottom: .22rem; height: 1.2rem; line-height: 1.2rem; z-index: 2;
  font-size: .7rem; font-weight: 600; color: #1d3a2c; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.cal .day .stay-label.cont { left: .5rem; }
.cal .day.info { border-color: var(--hl-primary); box-shadow: inset 0 0 0 2px var(--hl-primary); }

/* Le détail de l'occupation cliquée, sous son calendrier. */
.cal-detail { margin-top: .6rem; border: 1px solid var(--hl-primary); border-radius: var(--hl-radius); padding: .7rem .8rem; background: var(--hl-surface); }
.cal-detail h3 { margin: 0 0 .2rem; font-size: 1rem; }
.cal-detail p { margin: .1rem 0; font-size: .88rem; }
.cal-detail .cal-detail-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-detail .cal-detail-links { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .6rem; }
.cal-detail .cal-detail-close { margin-left: auto; }

.legend { display: flex; flex-wrap: wrap; gap: .8rem; font-size: .78rem; color: var(--hl-muted); margin: .5rem 0 1rem; }
.legend span { display: inline-flex; align-items: center; gap: .3rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.pagination { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; margin-top: 1rem; font-size: .88rem; }
.pagination .page { display: inline-block; min-width: 2.1rem; padding: .3rem .6rem; text-align: center; border: 1px solid var(--hl-border);
  border-radius: 6px; background: var(--hl-surface); color: var(--hl-text); text-decoration: none; line-height: 1.3; }
.pagination a.page:hover { border-color: var(--hl-primary); color: var(--hl-primary); }
.pagination .page.current { background: var(--hl-primary); border-color: var(--hl-primary); color: #fff; font-weight: 600; }
.pagination .page.disabled { color: var(--hl-muted); opacity: .55; }
.pagination .page.gap { border-color: transparent; background: none; min-width: auto; }
.pagination .page-info { color: var(--hl-muted); margin-left: .4rem; }

/* Responsive */
@media (max-width: 860px) {
  .hl-sidebar {
    position: fixed; inset: 0 30% 0 0; z-index: 50; transform: translateX(-100%);
    transition: transform .2s ease; width: min(280px, 80vw);
  }
  .hl-sidebar.open { transform: translateX(0); }
  .hl-burger { display: block; }
  .hl-content { padding: .9rem; }
}

/* Miniatures des listes (logements) : repère visuel rapide en tête de ligne. */
.thumb-col { width: 76px; padding-right: 0; }
.thumb {
    display: block;
    width: 64px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--hl-border);
    background: var(--hl-bg);
}
.thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--hl-muted);
    opacity: .55;
}
@media (max-width: 640px) {
    .thumb-col { width: 56px; }
    .thumb { width: 48px; height: 36px; }
}

/* Calendrier : cases cliquables et barre d'action de la sélection. */
.cal .day {
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  appearance: none; -webkit-appearance: none; width: 100%; display: block;
}
.cal .day:focus-visible { outline: 2px solid var(--hl-primary); outline-offset: 1px; }
.cal .day:hover:not(.sel) { border-color: var(--hl-primary); }
.cal .day.sel {
  box-shadow: inset 0 0 0 2px var(--hl-primary);
  border-color: var(--hl-primary);
}
.cal .day.out { cursor: default; }

.cal-bar {
  position: sticky; bottom: 0; z-index: 20; margin-top: 1rem;
  background: var(--hl-surface); border: 1px solid var(--hl-border);
  border-radius: var(--hl-radius); box-shadow: 0 -2px 14px rgba(0,0,0,.10);
}
.cal-bar-in {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .7rem .9rem;
}
.cal-bar-txt { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.cal-bar-txt strong { font-size: .92rem; }
.cal-bar form { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0; }
.cal-bar .btn[disabled] { opacity: .45; cursor: not-allowed; }
.cal-bar a.btn.disabled { opacity: .45; cursor: not-allowed; }
.cal-bar-rates { position: relative; }
.cal-bar-rates > summary { list-style: none; cursor: pointer; }
.cal-bar-rates > summary::-webkit-details-marker { display: none; }
.cal-bar-rates[open] > form {
  position: absolute; bottom: calc(100% + .5rem); right: 0; z-index: 25; width: max-content; max-width: min(40rem, 92vw);
  display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .7rem .8rem;
  background: var(--hl-surface); border: 1px solid var(--hl-border); border-radius: var(--hl-radius); box-shadow: var(--hl-shadow);
}
.cal-bar-rates label { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; margin: 0; }
@media (max-width: 640px) {
  .cal-bar-in { padding: .6rem; }
  .cal-bar-txt { min-width: 100%; }
}

/* Barre d'enregistrement flottante des écrans longs (fiche logement).
   Elle n'apparaît qu'une fois une modification faite : un bouton toujours
   présent finit par ne plus être vu. */
.save-dock {
  position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 60;
  display: flex; align-items: center; gap: .7rem;
  background: var(--hl-surface); border: 1px solid var(--hl-border);
  border-radius: 999px; padding: .5rem .6rem .5rem 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .16);
  animation: save-dock-in .18s ease-out;
}
.save-dock[hidden] { display: none; }
.save-dock-note { font-size: .84rem; color: var(--hl-muted); white-space: nowrap; }

/* Une modification en attente se voit : la barre s'accentue. */
.save-dock.is-dirty {
  border-color: var(--hl-primary);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .2), 0 0 0 3px color-mix(in srgb, var(--hl-primary) 18%, transparent);
}
.save-dock.is-dirty .save-dock-note { color: var(--hl-primary); font-weight: 600; }
.save-dock .btn { white-space: nowrap; }

@keyframes save-dock-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  .save-dock { left: .7rem; right: .7rem; justify-content: space-between; border-radius: var(--hl-radius); }
  .save-dock-note { font-size: .78rem; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .save-dock { animation: none; } }

/* Mode école : bandeau permanent de l'espace d'entraînement. */
.hl-school-banner { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; padding: .55rem 1rem; background: #fff4d6; color: #5c4300; border-bottom: 2px solid var(--hl-accent); font-size: .9rem; }
.hl-school-banner strong { letter-spacing: .04em; }
.hl-school-banner span { flex: 1; min-width: 240px; }
@media print { .hl-school-banner { display: none; } }

/* Recherche asynchrone d'un client (formulaires de réservation et de groupe). */
.guest-picker .gp-field { position: relative; }
.guest-picker .gp-field:nth-child(even) .gp-results { left: auto; right: 0; }
.gp-results { position: absolute; z-index: 30; left: 0; top: 100%; min-width: 100%; width: max-content; max-width: min(34rem, 92vw); max-height: 20rem; overflow-y: auto; margin-top: 2px; background: var(--hl-surface); border: 1px solid var(--hl-border); border-radius: var(--hl-radius); box-shadow: var(--hl-shadow); }
.gp-option { display: flex; flex-direction: column; gap: .1rem; padding: .45rem .7rem; cursor: pointer; border-bottom: 1px solid var(--hl-border); }
.gp-option[aria-selected="true"] { background: rgba(31, 111, 92, .1); }
.gp-option mark { background: rgba(232, 176, 75, .45); color: inherit; padding: 0; border-radius: 2px; }
.gp-details, .gp-stays, .gp-footer { font-size: .82rem; color: var(--hl-muted); }
.gp-footer { padding: .4rem .7rem; }
.gp-chip { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .5rem; font-size: .92rem; }
.guest-picker input.gp-locked { background: var(--hl-bg); color: var(--hl-muted); }

/* Carte-compteur cliquable (réception : aller à la section). */
a.hl-card-link { display: block; color: inherit; text-decoration: none; }
a.hl-card-link:hover { text-decoration: none; border-color: var(--hl-primary); }

/* Marque-pages : menu déroulant de la barre du haut. */
.hl-bookmarks { position: relative; }
.hl-bookmarks > summary { list-style: none; cursor: pointer; }
.hl-bookmarks > summary::-webkit-details-marker { display: none; }
.hl-bookmarks-menu { position: absolute; right: 0; top: calc(100% + .4rem); z-index: 60; min-width: 15rem; max-width: min(22rem, 90vw); padding: .3rem; background: var(--hl-surface); border: 1px solid var(--hl-border); border-radius: var(--hl-radius); box-shadow: var(--hl-shadow); }
.hl-bookmarks-menu a { display: flex; flex-direction: column; padding: .45rem .7rem; border-radius: 7px; color: var(--hl-text); font-size: .9rem; }
.hl-bookmarks-menu a:hover { background: var(--hl-bg); text-decoration: none; }
.hl-bookmarks-menu a .hint { font-size: .74rem; margin: 0; }
.hl-bookmarks-menu a.hl-bookmarks-edit { margin-top: .25rem; border-top: 1px solid var(--hl-border); border-radius: 0 0 7px 7px; color: var(--hl-muted); font-size: .82rem; }
@media print { .hl-bookmarks { display: none; } }

/* Réservations : bascule planning / liste. */
.hl-viewswitch { display: inline-flex; border: 1px solid var(--hl-border); border-radius: 8px; overflow: hidden; background: var(--hl-surface); }
.hl-viewswitch a { padding: .32rem .8rem; font-size: .85rem; color: var(--hl-text); }
.hl-viewswitch a:hover { text-decoration: none; background: var(--hl-bg); }
.hl-viewswitch a.active { background: var(--hl-primary); color: #fff; }
/* Réception du jour : vue d'ensemble. */
.hl-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.hl-overview a { display: flex; flex-direction: column; gap: .1rem; padding: .55rem .8rem; border: 1px dashed var(--hl-border); border-radius: var(--hl-radius); color: var(--hl-text); background: var(--hl-surface); }
.hl-overview a:hover { text-decoration: none; border-color: var(--hl-primary); }
.hl-overview strong { font-size: 1.15rem; }

/* Galerie de photos (logement, type de chambre). */
.hl-gallery-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--thumb, 148px), 1fr)); gap: .7rem; }
.hl-gallery-item { border: 1px solid var(--hl-border); border-radius: 10px; padding: .35rem; background: var(--hl-surface); cursor: grab; display: flex; flex-direction: column; gap: .3rem; }
.hl-gallery-item.dragging { opacity: .45; border-style: dashed; cursor: grabbing; }
.hl-gallery-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; background: var(--hl-bg); }
.hl-gallery-thumb a { display: block; width: 100%; height: 100%; }
.hl-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hl-gallery-pos { position: absolute; left: 5px; bottom: 5px; min-width: 1.5em; padding: 0 .35em; border-radius: 999px; background: rgba(0,0,0,.62); color: #fff; font-size: .74rem; font-weight: 700; text-align: center; }
.hl-gallery-cover { position: absolute; top: 5px; left: 5px; }
.hl-gallery-missing { position: absolute; top: 5px; right: 5px; }
.hl-gallery-actions { display: flex; gap: .2rem; }
.hl-gallery-actions form { margin: 0; flex: 1; }
.hl-gallery-actions form[hidden], .hl-gallery-cover[hidden] { display: none; }
.hl-gallery-actions .btn { width: 100%; padding: .2rem 0; font-size: .82rem; }
.hl-gallery-actions .btn[disabled] { opacity: .35; cursor: default; }
.hl-gallery-delete:hover { background: var(--hl-danger); color: #fff; border-color: var(--hl-danger); }
.hl-gallery-alt > summary { cursor: pointer; font-size: .78rem; color: var(--hl-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-gallery-alt form { display: flex; gap: .25rem; margin-top: .25rem; }
.hl-gallery-alt input { flex: 1; min-width: 0; font-size: .8rem; padding: .25rem .4rem; }
.hl-gallery-meta { font-size: .7rem; margin: 0; }
.hl-gallery-upload { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; margin-top: .8rem; }
.hl-gallery-drop { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: .2rem; padding: .7rem .9rem; border: 2px dashed var(--hl-border); border-radius: 10px; cursor: pointer; font-weight: 400; margin: 0; }
.hl-gallery-drop.over { border-color: var(--hl-primary); background: rgba(31,111,92,.06); }
.hl-gallery-drop input { font-size: .85rem; }

/* Onglets des rubriques regroupées sous une même entrée du menu. */
.hl-tabs { display: flex; gap: .15rem; flex-wrap: wrap; border-bottom: 2px solid var(--hl-border); margin: 0 0 1rem; }
.hl-tabs a { padding: .5rem .95rem; margin-bottom: -2px; border-bottom: 2px solid transparent; color: var(--hl-muted); font-weight: 600; font-size: .92rem; border-radius: 8px 8px 0 0; }
.hl-tabs a:hover { text-decoration: none; color: var(--hl-text); background: var(--hl-surface); }
.hl-tabs a.active { color: var(--hl-primary); border-bottom-color: var(--hl-primary); }
@media print { .hl-tabs { display: none; } }

/* Tarification, onglet « Prix » : une ligne par unité, chacune un formulaire, mais des colonnes alignées d'une ligne
   à l'autre — les intitulés sont donnés une fois, en tête ; en écran étroit, chaque champ reprend le sien. */
.hl-prices { border: 1px solid var(--hl-border); border-radius: var(--hl-radius); overflow: hidden; }
.hl-price-row { display: grid; grid-template-columns: minmax(8rem, 1.5fr) repeat(6, minmax(4.8rem, 1fr)) auto; gap: .5rem; align-items: center; padding: .5rem .7rem; margin: 0; }
.hl-price-row + .hl-price-row { border-top: 1px solid var(--hl-border); }
.hl-price-row.head { background: color-mix(in srgb, var(--hl-border) 35%, transparent); font-size: .74rem; font-weight: 700; color: var(--hl-muted); text-transform: uppercase; letter-spacing: .03em; }
.hl-price-row .nom { font-weight: 600; font-size: .92rem; }
.hl-price-row .cell { display: block; margin: 0; font-weight: 400; }
.hl-price-row .cell > span { display: none; }
.hl-price-row input { width: 100%; }
@media (max-width: 900px) {
  .hl-price-row { grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr)); row-gap: .6rem; }
  .hl-price-row.head { display: none; }
  .hl-price-row .nom { grid-column: 1 / -1; }
  .hl-price-row .cell > span { display: block; font-size: .76rem; color: var(--hl-muted); margin-bottom: .15rem; }
}

/* Messages présentés là où l'on se trouve quand l'écran a retrouvé sa position de défilement. */
.hl-flash-stack { position: fixed; top: .8rem; left: 50%; transform: translateX(-50%); z-index: 90; width: min(640px, 92vw); display: flex; flex-direction: column; gap: .4rem; pointer-events: none; }
.hl-flash-stack .alert { margin: 0; box-shadow: 0 6px 24px rgba(0,0,0,.18); cursor: pointer; pointer-events: auto; }
@media print { .hl-flash-stack { display: none; } }

/* Un seul bouton d'enregistrement par écran : il apparaît en bas à droite dès qu'une saisie change. */
.hl-savebar { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 85; display: flex; align-items: center; gap: .6rem; max-width: calc(100vw - 2.4rem);
  background: var(--hl-surface); border: 1px solid var(--hl-primary); border-radius: 999px; padding: .5rem .6rem .5rem 1.1rem;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .22), 0 0 0 3px color-mix(in srgb, var(--hl-primary) 18%, transparent); animation: save-dock-in .18s ease-out; }
.hl-savebar[hidden] { display: none; }
.hl-savebar-note { font-size: .86rem; font-weight: 600; color: var(--hl-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hl-savebar .btn { white-space: nowrap; border-radius: 999px; }
.hl-savebar-hidden { display: none !important; }
@media (max-width: 640px) { .hl-savebar { left: .6rem; right: .6rem; bottom: .6rem; border-radius: 14px; flex-wrap: wrap; justify-content: flex-end; } .hl-savebar-note { flex: 1 1 100%; } }
@media print { .hl-savebar { display: none; } }
