:root {
  --bg: #f6f7f5;
  --card: #ffffff;
  --ink: #1d2327;
  --muted: #6b737a;
  --line: #e5e8e4;
  --accent: #2f8a5f;
  --accent-ink: #ffffff;
  --accent-soft: #e6f3ec;
  --danger: #b4321f;
  --ok: #23915a;
  --radius: 12px;
  --side: 236px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171a; --card: #1d2125; --ink: #e8e9e7; --muted: #9aa2a9; --line: #2f343a;
    --accent: #45b07e; --accent-ink: #0c1a13; --accent-soft: #1b2f25; --danger: #e0705e; --ok: #4cc488;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.6rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 1rem; margin: 0 0 .8rem; }
h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 4px; }
small, .small { font-size: .82rem; }
.muted { color: var(--muted); }
.center { text-align: center; }
.sub { margin: 4px 0 0; }
code { background: var(--accent-soft); padding: 1px 5px; border-radius: 4px; font-size: .85em; word-break: break-all; }

/* ---------- Structure : barre latérale ---------- */
body.app { padding-left: var(--side); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--side); background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 16px 12px; z-index: 20; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; padding: 4px 8px 18px; line-height: 1.2; }
.brand:hover { text-decoration: none; }
.logo { width: 38px; height: 38px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: .9rem; flex: none; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav a { color: var(--ink); padding: 9px 12px; border-radius: 10px; display: flex; align-items: center; gap: 10px; opacity: .85; }
.nav a:hover { background: var(--bg); text-decoration: none; opacity: 1; }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; opacity: 1; }
.ico { width: 22px; text-align: center; filter: grayscale(.3); }
.badge { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--danger); color: #fff; font-size: .72rem; text-align: center; line-height: 20px; font-weight: 600; }
.logout { padding: 10px 12px 0; border-top: 1px solid var(--line); margin-top: 10px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .search { flex: 1; max-width: 560px; }
.quick { display: flex; gap: 8px; margin-left: auto; }
.menu-toggle { display: none; background: none; border: 0; font-size: 22px; color: var(--ink); cursor: pointer; padding: 0 4px; }

.container { max-width: 1280px; margin: 0 auto; padding: 24px 24px 60px; }
.container.narrow { max-width: 1000px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Cartes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.card h2 small { font-weight: 400; margin-left: 6px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.grid-2 > .card, .grid-2 > div > .card:last-child { margin-bottom: 0; }
.grid-2 { margin-bottom: 18px; }
.detail { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.alert-card { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); background: color-mix(in srgb, var(--danger) 4%, var(--card)); }
.next-action { border-left: 4px solid var(--accent); }
.next-action.warn { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, var(--card)); }
.next-action form.inline { display: inline-block; margin: 8px 6px 0 0; }

/* ---------- Formulaires ---------- */
input, select, textarea { font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--accent); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
textarea { resize: vertical; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-size: .82rem; color: var(--muted); font-weight: 500; }
.check-field label { display: flex; gap: 8px; align-items: center; padding: 8px 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row-form { display: flex; gap: 8px; align-items: center; }
.row-form.wrap { flex-wrap: wrap; }
.row-form input[type=text], .row-form input[type=search], .row-form input[type=email] { flex: 1; min-width: 160px; }
.row-form input[type=date], .row-form select { width: auto; }
.row-form .grow { flex: 2; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters .grow { flex: 1; min-width: 220px; }
.filters select { width: auto; }
.check-label, .inline-field { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.inline-field input { width: auto; }
form.inline { display: inline; margin: 0; }
fieldset.notify-box { border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
fieldset.notify-box legend { font-weight: 600; padding: 0 6px; }
.copy-row { display: flex; gap: 8px; }
.type-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.type-picker input { display: none; }
.type-picker span { display: inline-block; padding: 5px 12px; border-radius: 20px; border: 1px solid var(--line); cursor: pointer; font-size: .88rem; }
.type-picker input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 500; cursor: pointer; padding: 8px 14px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); white-space: nowrap; text-decoration: none !important; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); background: transparent; }
.btn.danger:hover { border-color: var(--danger); }
.link { background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.link.small { font-size: .78rem; color: var(--muted); }
.link.small:hover { color: var(--danger); }
.danger-zone { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line); }
.danger-zone form { margin: 0; }

.flash { padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; background: var(--accent-soft); border: 1px solid var(--accent); }
.flash.err { background: color-mix(in srgb, var(--danger) 9%, var(--card)); border-color: var(--danger); }

/* ---------- Pastilles ---------- */
.pill { display: inline-block; font-size: .74rem; font-weight: 600; padding: 2px 10px; border-radius: 20px; vertical-align: middle; white-space: nowrap;
  --c: var(--muted); color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.pill.ok { --c: var(--ok); } .pill.err { --c: var(--danger); } .pill.send { --c: #b0610f; }
.pill.cat { --c: #5b5bd6; }
.pill.c-mairie { --c: #2f6fd1; } .pill.c-ccas { --c: #0e8a7d; } .pill.c-cse { --c: #6d4fd8; } .pill.c-entreprise { --c: #4b55c9; }
.pill.c-association { --c: #c2376b; } .pill.c-club { --c: #b25f12; } .pill.c-clubseniors { --c: #a8571a; } .pill.c-collectivite { --c: #c26a0a; } .pill.c-autre { --c: #6b737a; }
.pill.int.c-froid { --c: #4b7bb8; } .pill.int.c-tiede { --c: #c08410; } .pill.int.c-chaud { --c: #c8452f; }
.pill.kind { --c: #2f8a5f; font-size: .7rem; padding: 1px 8px; }
.st-tarifs_a_envoyer { --c: #4b7bb8; } .st-a_relancer { --c: #c08410; } .st-devis_a_envoyer { --c: #7b5fd0; } .st-devis_a_suivre { --c: #d9822b; }
.st-devis_valide { --c: #2a9d8f; } .st-reservation { --c: #2f8a5f; } .st-a_facturer { --c: #7b4fd8; } .st-facture { --c: #3c7a4f; }
.st-paye { --c: #1f7a3a; } .st-perdu { --c: #8a8f96; }
.rs-en_attente { --c: #8a8f94; } .rs-a_transmettre { --c: #2f6fd1; } .rs-attente_resto { --c: #c08410; } .rs-validee { --c: #2f8a5f; }
.rs-modifiee { --c: #c2410c; } .rs-annulee { --c: #b4321f; } .rs-terminee { --c: #4b55c9; }
.act-appel { --c: #2f6fd1; } .act-email { --c: #7b4fd8; } .act-relance { --c: #c08410; } .act-proposition { --c: #2a9d8f; } .act-rdv { --c: #c2376b; } .act-note { --c: #6b737a; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--muted)); margin-right: 6px; }
.status-select { width: auto; font-size: .82rem; font-weight: 600; padding: 3px 8px; border-radius: 20px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--card)); border-color: transparent; }
.ok-txt { color: var(--ok); font-weight: 600; } .late-txt { color: var(--danger); font-weight: 600; }

/* Pastilles de filtre */
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips a { padding: 7px 14px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .9rem; white-space: nowrap; }
.chips a:hover { text-decoration: none; border-color: var(--muted); }
.chips a.active { background: var(--ink); color: var(--card); border-color: var(--ink); }
.chips-sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.chips select { width: auto; }

/* ---------- Tableaux ---------- */
.table-wrap { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-top: 1px solid var(--line); border-bottom: 0; }
.table tbody tr[data-href]:hover { background: var(--bg); cursor: pointer; }
.table tr.cancelled td { opacity: .55; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table.compact td, .table.compact th { padding: 7px 10px; }
.card > .table.compact { margin: 0 -4px; width: calc(100% + 8px); }
.pager { display: flex; gap: 18px; justify-content: center; align-items: center; margin: 10px 0; }
.line-chip { display: inline-block; font-size: .8rem; padding: 2px 8px; margin: 1px 4px 1px 0; border-radius: 6px; background: var(--bg); border: 1px solid var(--line); white-space: nowrap; }

/* ---------- Statistiques ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 10px; }
.stats.six { grid-template-columns: repeat(6, 1fr); margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; --c: var(--ink); }
.stat .num { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; color: var(--c); }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.st-appel { --c: #2f6fd1; background: color-mix(in srgb, #2f6fd1 6%, var(--card)); }
.st-email { --c: #7b4fd8; background: color-mix(in srgb, #7b4fd8 6%, var(--card)); }
.st-relance { --c: #c08410; background: color-mix(in srgb, #c08410 7%, var(--card)); }
.st-proposition { --c: #2a9d8f; background: color-mix(in srgb, #2a9d8f 7%, var(--card)); }
.st-reservation.stat { --c: #c8452f; background: color-mix(in srgb, #c8452f 6%, var(--card)); }
.st-sans { --c: var(--ink); }
.hero { display: flex; align-items: center; gap: 40px; padding: 22px 28px; border-radius: 16px; margin-bottom: 18px; color: #fff;
  background: linear-gradient(120deg, #2f8a5f, #2c6e6a); }
.hero > div { display: flex; flex-direction: column; }
.hero-lbl { opacity: .85; font-size: .9rem; }
.hero-num { font-size: 2.4rem; font-weight: 700; line-height: 1.1; }
.hero-num.small { font-size: 1.6rem; }
.hero-sub { opacity: .8; font-size: .85rem; }
.hero a { margin-left: auto; color: #fff; font-weight: 600; }
.bar-col { width: 35%; }
.bar-track { display: block; height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar { display: block; height: 100%; border-radius: 5px; min-width: 2px; background: var(--accent); }

/* ---------- Organismes & packages en cartes ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.org-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); }
.org-card:hover { border-color: var(--accent); text-decoration: none; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.org-name { font-weight: 700; font-size: 1.08rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-info { display: flex; flex-direction: column; gap: 3px; font-size: .9rem; overflow-wrap: anywhere; }
.org-foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; margin-top: auto; font-size: .85rem; }
.pkg-card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; }
.pkg-card.inactive { opacity: .6; }
.pkg-top { height: 74px; background: color-mix(in srgb, var(--accent) 14%, var(--card)); display: flex; justify-content: flex-end; align-items: flex-start; gap: 6px; padding: 12px; }
.pkg-top .pill { background: var(--card); }
.pkg-top.c-restauration { background: color-mix(in srgb, #d9822b 18%, var(--card)); }
.pkg-top.c-patinoire { background: color-mix(in srgb, #2f6fd1 15%, var(--card)); }
.pkg-top.c-attractions { background: color-mix(in srgb, #c2376b 14%, var(--card)); }
.pkg-top.c-groupescse { background: color-mix(in srgb, #6d4fd8 14%, var(--card)); }
.pkg-name { font-weight: 700; font-size: 1.05rem; padding: 14px 18px 2px; color: var(--ink); }
.pkg-sub { padding: 0 18px; font-size: .85rem; color: var(--accent); }
.pkg-foot { margin-top: auto; padding: 12px 18px; border-top: 1px solid var(--line); margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .9rem; }
.pkg-actions { display: flex; gap: 12px; align-items: center; }

/* ---------- Listes ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 8px 0; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.list li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 12px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.timeline li { padding: 9px 0 9px 14px; border-left: 2px solid var(--line); margin-left: 4px; }
.timeline .meta { font-size: .8rem; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.timeline .body { margin-top: 3px; overflow-wrap: anywhere; }
details summary { cursor: pointer; color: var(--muted); }
.mail-preview { white-space: pre-wrap; background: var(--bg); padding: 10px 12px; border-radius: 8px; font-size: .82rem; max-height: 320px; overflow: auto; }

/* ---------- Tâches ---------- */
.tasks { list-style: none; margin: 12px 0 0; padding: 0; }
.task { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.check { width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--muted); background: transparent; cursor: pointer; color: var(--accent-ink); font-size: 13px; line-height: 1; padding: 0; flex: none; }
.check:hover { border-color: var(--accent); }
.task.done .check { background: var(--accent); border-color: var(--accent); }
.task.done .task-title { text-decoration: line-through; color: var(--muted); }
.task-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.task-links { font-size: .8rem; display: flex; gap: 10px; flex-wrap: wrap; }
.due { font-size: .82rem; color: var(--muted); white-space: nowrap; }
.task.late .due { color: var(--danger); font-weight: 600; }

/* ---------- Réservation : lignes ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; font-size: .74rem; text-transform: uppercase; color: var(--muted); padding: 6px; }
.lines td { padding: 6px; vertical-align: top; }
.lines .num { text-align: right; }
.lines .line-qty { width: 80px; text-align: right; }
.lines .line-price { width: 90px; text-align: right; }
.lines .line-pkg { min-width: 220px; }
.lines .line-total { padding-top: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.notify-hint { display: block; color: #b0610f; margin-top: 3px; }
.lines tfoot td { border-top: 1px solid var(--line); padding-top: 10px; }

/* ---------- Planning ---------- */
.day.today { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.day-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.day-head h2 { margin: 0; }

/* ---------- Import ---------- */
.mapping { width: 100%; border-collapse: collapse; }
.mapping td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.mapping td:first-child { width: 40%; font-weight: 500; }
.sample { font-size: .8rem; color: var(--muted); }
.export-list { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Connexion / page publique ---------- */
.login-box { max-width: 380px; margin: 10vh auto 0; padding: 28px; }
.login-box h1 { margin-bottom: 10px; }

/* ---------- Mobile ---------- */
@media (max-width: 1100px) {
  .stats.six { grid-template-columns: repeat(3, 1fr); }
  .detail, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  body.app { padding-left: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.2); }
  body.nav-open .sidebar { transform: none; }
  .menu-toggle { display: block; }
  .topbar { padding: 10px 16px; flex-wrap: wrap; }
  .quick .btn:not(.primary) { display: none; }
  .container { padding: 16px 16px 50px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats.six { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .row-form { flex-wrap: wrap; }
  .row-form input[type=text], .row-form input[type=search], .row-form input[type=email] { flex-basis: 100%; }
  .row-form select { max-width: 100%; flex: 1; }
  .hero { flex-wrap: wrap; gap: 16px; }
  .card { padding: 16px; }
  .cards { grid-template-columns: 1fr; }
  .lines thead { display: none; }
  .lines tr.line { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .lines tr.line td { padding: 0; }
  .lines tr.line td:first-child, .lines tr.line td:nth-child(4) { grid-column: 1 / -1; }
  .lines .line-qty, .lines .line-price { width: 100%; }
  .lines .line-pkg { min-width: 0; width: 100%; }
  .lines tfoot tr { display: flex; flex-wrap: wrap; gap: 10px; }
}

@media print {
  .sidebar, .topbar, .no-print, .flash, .filters, .chips { display: none !important; }
  body.app { padding-left: 0; }
  body { background: #fff; color: #000; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  .day.today { box-shadow: none; }
  .container { padding: 0; max-width: none; }
}

/* ---------- Devis ---------- */
.stepper { list-style: none; display: flex; gap: 0; padding: 0; margin: 0 0 18px; overflow-x: auto; }
.stepper li { flex: 1; min-width: 110px; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); margin-right: -1px; font-size: .88rem; color: var(--muted); white-space: nowrap; }
.stepper li:first-child { border-radius: 10px 0 0 10px; } .stepper li:last-child { border-radius: 0 10px 10px 0; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); font-weight: 700; font-size: .8rem; flex: none; }
.stepper li.done { color: var(--ink); background: var(--accent-soft); }
.stepper li.done span { background: var(--accent); color: var(--accent-ink); }
.workflow h2 { margin-bottom: 8px; }
.workflow.highlight { border: 2px solid var(--accent); }
.qlines td { vertical-align: top; }
.qlines .q-pkg { min-width: 240px; margin-bottom: 4px; }
.qlines .q-label { margin-bottom: 4px; }
.qlines .q-qty { width: 70px; text-align: right; }
.qlines .q-ht, .qlines .q-ttc { width: 100px; text-align: right; }
.qlines .q-ttc { margin-top: 4px; }
.qlines .q-rate { width: 86px; }
.qlines .q-fee { width: 76px; text-align: right; }
.qlines td:first-child { min-width: 260px; }
.qlines .q-total { padding-top: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.small-input { font-size: .82rem; padding: 5px 8px; }
.q-totals { display: flex; justify-content: flex-end; }
.q-totals table { border-collapse: collapse; min-width: 300px; }
.q-totals td { padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.q-totals td:first-child { text-align: left; color: var(--muted); }
.q-totals tr.ttc td { font-weight: 700; font-size: 1.1rem; color: var(--ink); border-top: 2px solid var(--accent); }
.vat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 16px; }
.vat-grid .inline-field { justify-content: space-between; }
.vat-grid select { width: 96px; }
button[disabled] { opacity: .5; cursor: not-allowed; }
@media (max-width: 860px) {
  .qlines thead { display: none; }
  .qlines tr.qline { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .qlines tr.qline td { padding: 0; }
  .qlines tr.qline td:first-child { grid-column: 1 / -1; }
  .qlines .q-pkg { min-width: 0; width: 100%; }
  .qlines .q-qty, .qlines .q-ht, .qlines .q-ttc, .qlines .q-rate, .qlines .q-fee { width: 100%; }
  .qlines td:first-child { min-width: 0; }
}

/* ---------- Réservations espaces / bons de commande ---------- */
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: contents; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.final-box { border-left: 4px solid var(--accent); padding: 12px 16px; }
.final-box.warn { border-left-color: var(--danger); background: color-mix(in srgb, var(--danger) 5%, var(--card)); }
.order-box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.versions li { display: block; }
.changes { margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, #c2410c 7%, var(--card)); }
.changes del { color: var(--danger); } .changes ins { color: var(--ok); text-decoration: none; font-weight: 600; }
.res-timeline li { display: block; border-left: 2px solid var(--line); padding: 6px 0 6px 12px; }
.res-form .form-actions { margin-bottom: 18px; align-items: center; }

/* ---------- Espace restaurateur (mobile d'abord) ---------- */
body.resto { padding: 0; }
.resto-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap;
  padding: 10px 16px; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.resto-bar .chips { margin: 0; } .resto-bar .badge { margin-left: 6px; }
.resto-brand { display: flex; flex-direction: column; line-height: 1.2; }
.day-qty { margin-bottom: 8px; }
.order-card { border: 1px solid var(--line); border-left: 5px solid var(--ok); border-radius: 10px; padding: 10px 14px; margin: 10px 0; }
.order-card.pending { border-left-color: #c08410; background: color-mix(in srgb, #c08410 5%, var(--card)); }
.order-card.cancelled { border-left-color: var(--danger); opacity: .8; }
.order-card.cancelled .oc-body > p:first-child { text-decoration: line-through; }
.oc-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.oc-time { font-weight: 700; font-size: 1.05rem; } .oc-space { color: var(--muted); }
.oc-body p { margin: 4px 0; }
.oc-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.allergy { color: var(--danger); font-weight: 600; }
.changed { background: color-mix(in srgb, #c2410c 10%, transparent); border-radius: 4px; }
.kv.big { font-size: 1.02rem; } .kv.big dt, .kv.big dd { padding: 3px 4px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-h { text-align: center; font-size: .8rem; color: var(--muted); font-weight: 600; }
.cal-d { min-height: 84px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 6px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); font-size: .8rem; }
.cal-d.empty { background: transparent; border: 0; }
.cal-d.has { border-color: var(--accent); } .cal-d.today { box-shadow: 0 0 0 2px var(--accent); }
.cal-d:hover { text-decoration: none; filter: brightness(.98); }
.cal-n { font-weight: 700; } .cal-c { color: var(--accent); font-weight: 600; } .cal-p { color: #c2410c; font-weight: 600; }
@media (max-width: 600px) {
  .cal { gap: 3px; } .cal-d { min-height: 62px; padding: 4px; font-size: .68rem; }
  .oc-actions .btn { flex: 1; justify-content: center; }
  .resto-bar { padding: 8px 10px; }
}
.span-all { grid-column: 1 / -1; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.final-request { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); }
.confirm-card { max-width: 560px; margin: 40px auto; } .btn.big { font-size: 1.05rem; padding: 12px 18px; width: 100%; justify-content: center; }
.change-box { margin-top: 16px; } .change-box summary { cursor: pointer; color: var(--accent); font-weight: 600; padding: 6px 0; }

/* ---------- Plan des espaces (grille espace × horaire) ---------- */
.sp-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.sp-grid { display: grid; min-width: 900px; position: relative; }
.sp-head, .sp-name, .sp-cell { border-bottom: 1px solid var(--line); }
.sp-head { font-size: .72rem; color: var(--muted); padding: 6px 0 6px 3px; border-left: 1px solid var(--line); position: sticky; top: 0; background: var(--card); }
.sp-corner { position: sticky; left: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); }
.sp-name { position: sticky; left: 0; z-index: 2; background: var(--card); padding: 10px 12px; font-weight: 600; font-size: .88rem; border-right: 1px solid var(--line); display: flex; align-items: center; }
.sp-cell { min-height: 58px; border-left: 1px dashed color-mix(in srgb, var(--line) 70%, transparent); display: block; }
.sp-cell.hour { border-left: 1px solid var(--line); }
.sp-cell:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.sp-cell:hover::after { content: '+'; display: block; text-align: center; line-height: 58px; color: var(--accent); font-weight: 700; }
.sp-block { z-index: 1; margin: 5px 2px; border-radius: 8px; padding: 5px 8px; font-size: .78rem; line-height: 1.25; overflow: hidden;
  color: #fff; background: var(--c, #2f8a5f); box-shadow: 0 1px 3px rgba(0,0,0,.18); text-decoration: none; transition: transform .12s ease, box-shadow .12s ease; }
.sp-block:hover { transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,.22); text-decoration: none; color: #fff; }
.sp-block.rs-en_attente { background: repeating-linear-gradient(45deg, #8a8f94, #8a8f94 6px, #9ba0a5 6px, #9ba0a5 12px); }
.sp-block strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-legend { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; font-size: .8rem; }
.sp-legend span { display: inline-flex; align-items: center; gap: 5px; } .sp-legend i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); display: inline-block; }
.sp-free { margin-top: 14px; } .sp-free li { display: block; }
.sp-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--danger); z-index: 4; pointer-events: none; }
.sp-grid { user-select: none; touch-action: pan-y; }
.sp-sel { position: absolute; z-index: 5; border-radius: 8px; pointer-events: none; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--accent) 22%, transparent); border: 2px dashed var(--accent); color: var(--accent); font-weight: 700; font-size: .8rem; }
.sp-sel.bad { background: color-mix(in srgb, var(--danger) 18%, transparent); border-color: var(--danger); color: var(--danger); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg a { padding: 7px 14px; color: var(--ink); font-size: .9rem; } .seg a:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) 8%, transparent); }
.seg a.active { background: var(--accent); color: #fff; }
.spw { width: 100%; min-width: 900px; border-collapse: collapse; table-layout: fixed; }
.spw th, .spw td { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); padding: 0; text-align: left; vertical-align: top; }
.spw thead th { padding: 8px 10px; font-size: .82rem; background: var(--card); } .spw thead th.today { color: var(--accent); }
.spw tbody th, .spw tfoot th { padding: 10px 12px; font-size: .88rem; width: 170px; border-left: 0; }
.spw-cell a { display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; min-height: 92px; color: var(--ink);
  background: color-mix(in srgb, var(--accent) calc(var(--p) * .22), transparent); transition: background-color .15s ease; }
.spw-cell a:hover { text-decoration: none; background: color-mix(in srgb, var(--accent) calc(var(--p) * .22 + 8%), transparent); }
.spw-cell.today a { box-shadow: inset 0 0 0 2px var(--accent); }
.spw-pct { font-weight: 700; font-size: 1rem; } .spw-pct.full { color: var(--danger); } .spw-pct.free { color: var(--muted); font-weight: 500; }
.spw-bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; } .spw-bar i { display: block; height: 100%; width: var(--p); background: var(--accent); }
.spw-item { font-size: .72rem; padding: 1px 6px; border-radius: 5px; color: #fff; background: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spw-total { padding: 10px; text-align: center !important; background: color-mix(in srgb, var(--ink) 3%, transparent); }
.spw thead th:last-child { text-align: center; }

.sp-grid .sp-cell { cursor: crosshair; }
.sp-tip { display: flex; gap: 14px; align-items: center; padding: 12px 16px; margin-bottom: 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); font-size: .9rem; }
.sp-tip-demo { display: inline-flex; gap: 2px; flex: none; padding: 6px; border: 1px dashed var(--accent); border-radius: 8px; }
.sp-tip-demo i { width: 14px; height: 22px; border-radius: 3px; background: var(--accent); opacity: .15; animation: sptip 2.4s infinite; }
.sp-tip-demo i:nth-child(2) { animation-delay: .3s; } .sp-tip-demo i:nth-child(3) { animation-delay: .6s; } .sp-tip-demo i:nth-child(4) { animation-delay: .9s; }
@keyframes sptip { 0%, 10% { opacity: .15; } 30%, 80% { opacity: .85; } 100% { opacity: .15; } }
.sp-export { margin: 14px 0 6px; align-items: center; }

.brand-logo { width: 46px; height: auto; flex: none; }
.login-logo { display: block; width: min(240px, 80%); height: auto; margin: 0 auto 14px; }
.login-box h1 { text-align: center; } .login-role { text-align: center; margin-top: -4px; }
.login-switch { display: flex; flex-direction: column; gap: 2px; margin-top: 18px; padding: 12px 14px; border-radius: 10px;
  border: 1px dashed var(--line); color: var(--ink); font-size: .9rem; transition: background-color .15s ease, border-color .15s ease; }
.login-switch span { color: var(--accent); }
.login-switch:hover { text-decoration: none; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, transparent); }
.resto-bar { justify-content: flex-start; } .resto-bar .chips { margin-left: auto; }
.center { text-align: center; }

/* ---------- Planning façon agenda ---------- */
.container:has(.cal-wrap), .container:has(.cal-month) { max-width: none; }
.filters input[type=date] { flex: 0 0 auto; width: auto; }
.ev-chip .ev-time { white-space: nowrap; flex: 0 0 auto; }
.cal-head .actions { flex-wrap: wrap; }
.cal-legend { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; color: var(--muted); margin-left: auto; align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.cal-wrap { padding: 0; overflow: auto; max-height: calc(100vh - 230px); }
.cal { display: grid; min-width: 760px; }
.cal.cal-7 { grid-template-columns: 58px repeat(7, minmax(96px, 1fr)); }
.cal.cal-1 { grid-template-columns: 58px 1fr; min-width: 0; }
.cal-corner, .cal-dh { position: sticky; top: 0; z-index: 3; background: var(--card); border-bottom: 1px solid var(--line); }
.cal-dh { padding: 10px 8px; text-align: center; font-weight: 600; font-size: .88rem; border-left: 1px solid var(--line); }
.cal-dh a { color: var(--ink); }
.cal-dh.today a { color: #fff; background: var(--accent); padding: 3px 10px; border-radius: 999px; }
.cal-allday-lbl { position: static; font-size: .7rem; color: var(--muted); padding: 6px 4px; text-align: right; z-index: 1; }
.cal-allday { border-left: 1px solid var(--line); border-bottom: 2px solid var(--line); padding: 3px; min-height: 30px; display: flex; flex-direction: column; gap: 3px; }
.cal-hours { display: grid; grid-auto-rows: var(--h); }
.cal-hours span { font-size: .72rem; color: var(--muted); text-align: right; padding-right: 8px; transform: translateY(-7px); }
.cal-hours span:first-child { transform: none; }
.cal-col { position: relative; height: calc(var(--h) * var(--rows)); border-left: 1px solid var(--line); cursor: copy;
  background-image: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px calc(var(--h) / 2), color-mix(in srgb, var(--line) 45%, transparent) calc(var(--h) / 2) calc(var(--h) / 2 + 1px), transparent calc(var(--h) / 2 + 1px) var(--h)); }
.cal-col:hover { background-color: color-mix(in srgb, var(--accent) 3%, transparent); }
.cal-col.today { background-color: color-mix(in srgb, var(--accent) 6%, transparent); }
.ev { font: inherit; text-align: left; cursor: pointer; border: 0; border-left: 4px solid var(--c); border-radius: 6px; color: var(--ink);
  background: color-mix(in srgb, var(--c) 16%, var(--card)); padding: 4px 7px; display: flex; flex-direction: column; overflow: hidden; line-height: 1.25;
  transition: transform .12s ease, box-shadow .12s ease; }
.ev:hover, .ev:focus-visible { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0, 0, 0, .14); z-index: 2; outline: none; }
.ev-block { position: absolute; z-index: 1; }
.ev-time { font-size: .7rem; font-weight: 600; color: color-mix(in srgb, var(--c) 70%, var(--ink)); }
.ev-title { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-meta { font-size: .72rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-chip { flex-direction: row; gap: 6px; align-items: baseline; padding: 2px 6px; width: 100%; }
.ev-chip .ev-meta { display: none; }
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); padding: 0; overflow: hidden; }
.cm-dow { padding: 8px; font-size: .78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; border-bottom: 1px solid var(--line); text-align: center; }
.cm-day { min-height: 118px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 4px; display: flex; flex-direction: column; gap: 3px; cursor: copy; min-width: 0; }
.cm-day:nth-child(7n) { border-right: 0; }
.cm-day.out { background: color-mix(in srgb, var(--line) 30%, transparent); }
.cm-day.out .cm-num { color: var(--muted); }
.cm-num { align-self: flex-end; font-size: .82rem; font-weight: 600; color: var(--ink); width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; }
.cm-day.today .cm-num { background: var(--accent); color: #fff; }
.cm-more { font-size: .75rem; padding-left: 4px; }
.evd { border: 0; border-radius: 16px; padding: 22px 24px; width: min(520px, calc(100vw - 24px)); background: var(--card); color: var(--ink); box-shadow: 0 24px 60px rgba(0, 0, 0, .3); }
.evd::backdrop { background: rgba(15, 20, 25, .45); backdrop-filter: blur(3px); }
.evd-close { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 1.6rem; cursor: pointer; color: var(--muted); line-height: 1; }
.evd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border-left: 5px solid var(--c); padding-left: 12px; margin: 0 26px 14px 0; }
.evd-head h2 { margin: 2px 0 0; font-size: 1.2rem; }
.evd-list { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 0 0 18px; font-size: .92rem; }
.evd-list dt { color: var(--muted); }
.evd-list dd { margin: 0; }
.evd-lines { margin: 0; padding-left: 16px; }
.evd-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; }
.evd-actions form { margin: 0; }
@media (max-width: 700px) {
  .cm-day { min-height: 76px; padding: 2px; }
  .ev-chip .ev-time { display: none; }
  .ev-chip { padding: 1px 4px; } .ev-chip .ev-title { font-size: .7rem; }
  .cal-legend { margin-left: 0; }
  .evd-list { grid-template-columns: 1fr; gap: 2px; } .evd-list dd { margin-bottom: 6px; }
}
@media print {
  .cal-wrap { max-height: none; overflow: visible; }
  .ev { box-shadow: none !important; }
}
.sig-grid { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.sig-grid textarea { width: 100%; }
.sig-logo { width: 90px; height: auto; border: 1px solid var(--line); border-radius: 8px; }
@media (max-width: 600px) { .sig-grid { grid-template-columns: 1fr; } }
/* Devis : colonne des lignes plus large (frais de billetterie) */
.container:has(#quote-form) { max-width: 1560px; }
.detail:has(#quote-form) { grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); }
@media (max-width: 1100px) { .detail:has(#quote-form) { grid-template-columns: 1fr; } }
