/* NightTicket — même charte que l'appli Android (fond nuit, or « Conso », violet « Vestiaire ») */
@font-face { font-family: Roboto; font-style: normal; font-weight: 400; font-display: swap; src: url(/assets/fonts/roboto-400.woff2) format('woff2'); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 500; font-display: swap; src: url(/assets/fonts/roboto-500.woff2) format('woff2'); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 700; font-display: swap; src: url(/assets/fonts/roboto-700.woff2) format('woff2'); }
@font-face { font-family: Roboto; font-style: normal; font-weight: 900; font-display: swap; src: url(/assets/fonts/roboto-900.woff2) format('woff2'); }
:root {
  /* thème clair (option) */
  --bg: #f6f4fa; --card: #ffffff; --card2: #f0ecf7; --text: #1d1726; --muted: #6b6478; --line: #e5dfee;
  --gold: #F2C14E; --gold-ink: #1A1206; --link: #7a4fd6; --violet: #8B5CF6;
  --c-conso: #c98500; --c-vest: #6d3fe0;
  --ok: #1f8a5b; --ok-bg: #e3f4ec; --warn: #9a5b00; --warn-bg: #fff2d6; --err: #c4373c; --err-bg: #fde7e8; --info-bg: #efe9fe;
  --radius: 14px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgb(20 10 40 / .05), 0 8px 24px rgb(20 10 40 / .05);
  font-family: Roboto, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
/* thème nuit = couleurs exactes de l'appli (NightColors) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E0B14; --card: #17121F; --card2: #261D35; --text: #F1ECF8; --muted: #BDB3CC; --line: #2B2238;
  --link: #F2C14E; --c-conso: #F2C14E; --c-vest: #8B5CF6;
  --ok: #3fc086; --ok-bg: #12291f; --warn: #F2C14E; --warn-bg: #2e2410; --err: #ff7479; --err-bg: #3a1518; --info-bg: #261D35;
  --shadow: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #0E0B14; --card: #17121F; --card2: #261D35; --text: #F1ECF8; --muted: #BDB3CC; --line: #2B2238;
    --link: #F2C14E; --c-conso: #F2C14E; --c-vest: #8B5CF6;
    --ok: #3fc086; --ok-bg: #12291f; --warn: #F2C14E; --warn-bg: #2e2410; --err: #ff7479; --err-bg: #3a1518; --info-bg: #261D35;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.5; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- barre du haut ---------- */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 22px; background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 900; font-size: 20px; letter-spacing: -.01em; color: var(--c-conso); }
:root[data-theme="light"] .brand, :root:not([data-theme]) .brand { color: var(--text); }
.brand:hover { text-decoration: none; }
.brand svg { flex: none; border-radius: 8px; }
.etab-pick, .etab-name { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; margin: 0; }
.etab-pick select { width: auto; padding: 5px 8px; font-weight: 600; background: var(--card2); border-color: transparent; }
.main-nav { display: flex; align-items: center; gap: 2px; flex: 1; flex-wrap: wrap; }
.main-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; }
.main-nav a:hover { background: var(--card2); color: var(--text); text-decoration: none; }
.main-nav a.on { background: var(--card2); color: var(--text); box-shadow: inset 0 -2px 0 var(--gold); }
.side-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav-ico { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; }
.nav-ico:hover, .nav-ico.on { background: var(--card2); color: var(--text); text-decoration: none; filter: none; }
.nav-user { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; color: var(--text); font-weight: 500; }
.nav-user:hover, .nav-user.on { background: var(--card2); text-decoration: none; }
.avatar-sm { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); font-weight: 900; font-size: 13px; }
@media (max-width: 900px) { .main-nav a span { display: none; } .main-nav a { padding: 8px 10px; } .hide-sm { display: none; } }
@media (max-width: 600px) { .top { padding: 10px 14px; gap: 8px; } .main-nav { order: 3; flex-basis: 100%; justify-content: space-between; } .brand span { display: none; } }

main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 26px 22px 40px; flex: 1; }
main.narrow { max-width: 430px; padding-top: 8vh; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; }

h1 { font-size: 26px; margin: 0 0 18px; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 17px; margin: 28px 0 12px; font-weight: 700; }
h3 { font-size: 15px; margin: 0 0 10px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num, .kpi-n, .nb-val { font-variant-numeric: tabular-nums; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card-head h2 { margin: 0; color: var(--c-conso); }
:root[data-theme="light"] .card-head h2, :root:not([data-theme]) .card-head h2 { color: var(--text); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- formulaires et boutons ---------- */
label { display: block; font-size: 13px; font-weight: 500; margin: 14px 0 5px; color: var(--muted); }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=password], input[type=number], input[type=search], input[type=date], input[type=time], textarea, select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); font: inherit; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--gold); outline-offset: -1px; }
input[type=file] { font: inherit; font-size: 13px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--text); }
button, .btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 12px; border: 1px solid var(--gold); background: var(--gold); color: var(--gold-ink);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:hover, button:hover { filter: brightness(1.06); text-decoration: none; }
button.secondary, .btn.secondary { background: var(--card2); color: var(--text); border-color: var(--line); }
button.violet, .btn.violet { background: var(--violet); border-color: var(--violet); color: #fff; }
button.danger, .btn.danger { background: transparent; color: var(--err); border-color: var(--line); }
button.danger-solid { background: var(--err); border-color: var(--err); color: #fff; }
button.small, .btn.small { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
button.link { background: none; border: 0; padding: 0; color: var(--muted); font-weight: 400; }
button.full { width: 100%; margin-top: 20px; padding: 12px; font-size: 16px; }
button:disabled { opacity: .45; cursor: not-allowed; filter: none; }
form.inline { display: inline; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } main { padding: 18px 14px 32px; } }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ico-btn { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; font-size: 18px; font-weight: 700; }
.ico-btn:hover { color: var(--text); border-color: var(--gold); text-decoration: none; filter: none; background: var(--card); }
.ico-btn.danger:hover { color: var(--err); border-color: var(--err); }
.actions-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.flash { padding: 11px 15px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; font-weight: 500; }
.flash.ok { background: var(--ok-bg); color: var(--ok); }
.flash.err { background: var(--err-bg); color: var(--err); }
.flash.info { background: var(--info-bg); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; padding: 2px 9px; border-radius: 99px; background: var(--card2); color: var(--muted); font-weight: 500; white-space: nowrap; }
.tag.ok { color: var(--ok); background: var(--ok-bg); }
.tag.warn { color: var(--warn); background: var(--warn-bg); }
.tag.err { color: var(--err); background: var(--err-bg); }
.tag.ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tb { display: inline-block; font-size: 11px; font-weight: 900; letter-spacing: .04em; padding: 3px 8px; border-radius: 7px; }
.tb.conso { background: var(--gold); color: var(--gold-ink); }
.tb.vestiaire { background: var(--violet); color: #fff; }
.warn-ink { color: var(--warn); }
.err-ink { color: var(--err); }
code, .mono { font-family: ui-monospace, "Roboto Mono", Consolas, monospace; font-size: 13px; }
code { background: var(--card2); padding: 1px 6px; border-radius: 5px; }
.empty { padding: 30px; text-align: center; color: var(--muted); }

/* ---------- tableaux ---------- */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
th.r, td.r { text-align: right; }
td.actions { white-space: nowrap; text-align: right; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td, tbody tr:hover td { background: color-mix(in srgb, var(--card2) 55%, transparent); }
tr.cancelled td { color: var(--muted); }
tr.cancelled td.strike { text-decoration: line-through; }
table.bd td, table.bd th { padding: 8px 6px; }
table.bd th:first-child, table.bd td:first-child { padding-left: 0; }
.tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* ---------- en-tête de page, période ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.period { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.period-custom { display: flex; gap: 6px; align-items: center; margin: 0; }
.period-custom input[type=date] { width: auto; padding: 6px 9px; }
.seg-mini { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; padding: 3px; background: var(--card); }
.seg-mini a, .seg-mini button { display: inline-block; color: var(--muted); padding: 5px 12px; border-radius: 9px; font-weight: 500; font-size: 14px; background: none; border: 0; }
.seg-mini a:hover { color: var(--text); text-decoration: none; }
.seg-mini a.on, .seg-mini button.on { background: var(--gold); color: var(--gold-ink); font-weight: 700; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filters select, .filters input { width: auto; padding: 7px 10px; }
.filters input[type=search] { min-width: 160px; }

/* ---------- chiffres clés ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { display: flex; flex-direction: column; gap: 3px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.kpi-label { font-size: 12.5px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.kpi-n { font-size: 32px; font-weight: 900; line-height: 1.1; letter-spacing: -.02em; }
.kpi-sub { display: flex; gap: 8px; align-items: center; font-size: 12.5px; flex-wrap: wrap; min-height: 18px; }
.kpi.conso { background: var(--gold); border-color: var(--gold); color: var(--gold-ink); }
.kpi.conso .kpi-label, .kpi.conso .muted { color: color-mix(in srgb, var(--gold-ink) 70%, transparent); }
.kpi.vestiaire { background: var(--violet); border-color: var(--violet); color: #fff; }
.kpi.vestiaire .kpi-label, .kpi.vestiaire .muted { color: rgb(255 255 255 / .78); }
.kpi.conso .delta, .kpi.vestiaire .delta { background: rgb(0 0 0 / .14); color: inherit; }
.delta { display: inline-block; font-weight: 700; padding: 0 7px; border-radius: 99px; font-size: 12px; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--err); background: var(--err-bg); }
.delta.flat { color: var(--muted); background: var(--card2); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--err-bg); color: var(--err); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.live-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* ---------- graphiques ---------- */
.sbars-wrap { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.sbars-y { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted); text-align: right; height: 200px; padding: 0 0 0; font-variant-numeric: tabular-nums; }
.sbars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 2px; height: 200px; margin-bottom: 22px; align-items: end;
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line), var(--line)) 0 100px / 100% 1px no-repeat; }
.sb-col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; outline: none; color: inherit; }
.sb-col:hover { text-decoration: none; }
.sb-stack { display: flex; flex-direction: column; gap: 2px; width: 100%; max-width: 34px; margin: 0 auto; min-height: 0; }
.sb { display: block; min-height: 2px; }
.sb.c { background: var(--c-conso); }
.sb.v { background: var(--c-vest); }
.sb-stack > .sb:first-child { border-radius: 4px 4px 0 0; }
.sb-x { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.sbars:hover .sb-stack { opacity: .5; }
.sb-col:hover .sb-stack, .sb-col:focus-visible .sb-stack { opacity: 1; }
.sb-col[data-tip]:hover::after, .sb-col[data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); z-index: 5;
  white-space: nowrap; font-size: 12px; padding: 6px 10px; border-radius: 8px; background: var(--text); color: var(--bg); pointer-events: none; font-weight: 500; }
.sb-col:nth-child(-n+3)[data-tip]::after { left: 0; transform: none; }
.sb-col:nth-last-child(-n+3)[data-tip]::after { left: auto; right: 0; transform: none; }
.legend { display: flex; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg.c { background: var(--c-conso); } .lg.v { background: var(--c-vest); }
.num-bar { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.nb-track { flex: 1; height: 10px; border-radius: 5px; background: var(--card2); overflow: hidden; display: flex; gap: 2px; }
.nb-fill { display: block; height: 100%; }
.nb-fill.c { background: var(--c-conso); } .nb-fill.v { background: var(--c-vest); }
.nb-fill.g { background: var(--muted); }
.nb-val { min-width: 38px; text-align: right; font-weight: 700; }
.nb-pct { min-width: 38px; text-align: right; font-size: 12px; }
.split { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; margin: 10px 0 6px; }
.split .c { background: var(--c-conso); } .split .v { background: var(--c-vest); }

/* ---------- alertes, appareils ---------- */
.flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.flags li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; }
.flags li > span { display: flex; flex-direction: column; }
.flags li.err { background: var(--err-bg); color: var(--err); }
.flags li.warn { background: var(--warn-bg); color: var(--warn); }
.flags li svg { flex: none; margin-top: 2px; }
.flags .muted { color: inherit; opacity: .85; }
.okline { display: flex; gap: 8px; align-items: center; color: var(--ok); font-weight: 500; }
.dev-list { display: flex; flex-direction: column; }
.dev { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.dev:first-child { border-top: 0; padding-top: 0; }
.dev-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--card2); color: var(--muted); flex: none; }
.dev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.code-big { font-family: ui-monospace, "Roboto Mono", Consolas, monospace; font-size: 34px; font-weight: 700; letter-spacing: .12em; color: var(--gold-ink); background: var(--gold); padding: 10px 18px; border-radius: 14px; display: inline-block; }
.pair-box { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; padding: 18px; border-radius: var(--radius); border: 2px dashed var(--gold); margin-bottom: 16px; }

/* ---------- liste des soirées ---------- */
.soiree-day { font-weight: 700; }
.soiree-day small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.mini-split { display: flex; height: 8px; width: 110px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--card2); }
.mini-split .c { background: var(--c-conso); } .mini-split .v { background: var(--c-vest); }

/* ---------- onglets ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }
.tabs a.on { color: var(--text); border-color: var(--gold); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 14px; }

/* ---------- connexion ---------- */
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 22px; }
.auth-brand .t { font-size: 34px; font-weight: 900; color: var(--c-conso); letter-spacing: -.01em; }
.auth-brand .s { color: var(--muted); font-size: 14px; }
.wait-card { text-align: center; padding: 32px; }

/* ---------- divers ---------- */
.switch { display: flex; align-items: center; gap: 10px; margin: 0; font-weight: 500; cursor: pointer; color: var(--text); }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .sw { width: 38px; height: 22px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .15s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .sw { background: var(--gold); }
.switch input:checked + .sw::after { transform: translateX(16px); background: var(--gold-ink); }
.switch input:focus-visible + .sw { outline: 2px solid var(--gold); outline-offset: 2px; }
.role-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (max-width: 600px) { .role-pick { grid-template-columns: 1fr; } }
.role-opt { position: relative; margin: 0; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; color: var(--text); background: var(--bg); }
.role-opt input { position: absolute; opacity: 0; }
.role-opt:has(input:checked) { border-color: var(--gold); background: var(--card2); }
.role-opt strong { font-size: 14px; }
.role-opt span { font-size: 12px; color: var(--muted); font-weight: 400; }
details.menu { display: inline-block; position: relative; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 230px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 40px rgb(0 0 0 / .3); padding: 6px; display: flex; flex-direction: column; }
.menu-list form { display: block; margin: 0; }
.menu-list button, .menu-list a { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--text); font-weight: 400; padding: 8px 10px; border-radius: 8px; font-size: 14px; }
.menu-list button:hover, .menu-list a:hover { background: var(--card2); text-decoration: none; filter: none; }
.menu-list .danger-item { color: var(--err); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; }
pre.code { background: var(--card2); padding: 14px; border-radius: 12px; overflow-x: auto; font-size: 12.5px; line-height: 1.5; margin: 8px 0 0; }
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 26px; text-align: center; background: var(--bg); }
.drop:hover { border-color: var(--gold); }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.theme-opt { margin: 0; cursor: pointer; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border: 1px solid var(--line); border-radius: 12px; font-weight: 500; font-size: 13px; text-align: center; color: var(--text); }
.theme-opt input { position: absolute; opacity: 0; }
.theme-opt:has(input:checked) { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold) inset; }
.theme-prev { display: block; height: 56px; border-radius: 8px; position: relative; overflow: hidden; }
.tp-dark { background: #0E0B14; } .tp-light { background: #f6f4fa; border: 1px solid #e5dfee; } .tp-auto { background: linear-gradient(90deg, #f6f4fa 50%, #0E0B14 50%); }
.theme-prev i { position: absolute; left: 10px; top: 12px; width: 38%; height: 30px; border-radius: 6px; background: #F2C14E; }
.theme-prev i + i { left: auto; right: 10px; background: #8B5CF6; }

/* ---------- impression du rapport ---------- */
.print-only { display: none; }
@media print {
  :root, :root[data-theme="dark"] { --bg: #fff; --card: #fff; --card2: #f2f2f2; --text: #000; --muted: #555; --line: #ccc; --c-conso: #b07800; --c-vest: #5a32c8; --shadow: none; color-scheme: light; }
  .top, .foot, .no-print, .period { display: none !important; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; }
  .card, .kpi, .table-wrap { break-inside: avoid; border-color: #ccc; }
  .kpi.conso, .kpi.vestiaire { background: #fff; color: #000; border-width: 2px; }
  .kpi.conso { border-color: #b07800; } .kpi.vestiaire { border-color: #5a32c8; }
  .kpi.conso .kpi-label, .kpi.vestiaire .kpi-label { color: #555; }
  body { font-size: 12px; }
  .sb, .nb-fill, .tb, .split span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- mises en page ---------- */
.grid-main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .grid-main { grid-template-columns: 1fr; } }
.kpi.warn { border-color: color-mix(in srgb, var(--warn) 60%, var(--line)); }
.kpi.warn .kpi-n { color: var(--warn); }

@media (max-width: 600px) {
  .card { overflow-x: auto; }
  .num-bar { min-width: 0; }
  table.bd .nb-track, table.bd .nb-pct { display: none; }
  .period-custom { flex-wrap: wrap; }
  .period-custom input[type=date] { flex: 1 1 120px; }
  .kpi-n { font-size: 28px; }
}

/* ---------- licences, options verrouillées ---------- */
.main-nav a.locked { opacity: .55; }
.upsell { display: flex; gap: 16px; align-items: flex-start; border: 1.5px dashed color-mix(in srgb, var(--gold) 55%, var(--line)); }
.upsell.big { max-width: 640px; margin: 6vh auto 0; padding: 28px; }
.upsell .lock { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--gold); color: var(--gold-ink); }
.upsell h2 { margin: 0 0 6px; }
.app-pick select { max-width: 200px; }
.group-toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin: 0; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.opt-item { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--text); font-weight: 500; cursor: pointer; }
.opt-item input { margin-top: 3px; }
.opt-item:has(input:checked) { border-color: var(--gold); background: var(--card2); }
.opt-item span small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.plan-card { display: flex; flex-direction: column; gap: 8px; }
.plan-card .price { font-size: 26px; font-weight: 900; }
.plan-card ul { margin: 0; padding-left: 18px; font-size: 13px; }
.pill-list { display: flex; flex-wrap: wrap; gap: 5px; }
.ver-ok { color: var(--ok); } .ver-old { color: var(--warn); }

/* ---------- éditeur de configuration de l'appli ---------- */
.cfg-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .cfg-layout { grid-template-columns: 1fr; } }
.cfg-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row-item { display: grid; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.row-item input, .row-item select { padding: 7px 9px; }
.row-key { grid-template-columns: 26px minmax(0, 1.4fr) 130px 120px auto auto; }
.row-pay { grid-template-columns: minmax(0, 1fr) auto auto; }
.row-user { grid-template-columns: minmax(0, 1.2fr) 140px 150px auto; }
@media (max-width: 700px) { .row-key, .row-user { grid-template-columns: 1fr 1fr; } }
.swatch { width: 22px; height: 22px; border-radius: 6px; border: 2px solid rgb(255 255 255 / .2); }
.perm-table td, .perm-table th { text-align: center; }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.phone-prev { background: #0E0B14; border-radius: 26px; padding: 14px; border: 6px solid #261D35; color: #F1ECF8; font-family: Roboto, sans-serif; }
.phone-prev .pp-top { display: flex; justify-content: space-between; font-size: 12px; color: #BDB3CC; margin-bottom: 10px; }
.phone-prev .pp-keys { display: grid; gap: 8px; }
.phone-prev .pp-key { border-radius: 16px; padding: 18px 10px; text-align: center; font-weight: 900; font-size: 20px; letter-spacing: .02em; }
.ticket-prev { background: #fff; color: #000; border-radius: 4px; padding: 14px 12px; text-align: center; font-family: "DejaVu Sans", Roboto, sans-serif; box-shadow: 0 6px 20px rgb(0 0 0 / .35); }
.ticket-prev img { max-width: 70%; max-height: 70px; filter: grayscale(1) contrast(1.8); display: block; margin: 0 auto 6px; }
.ticket-prev .tp-date { font-size: 22px; font-weight: 800; border-top: 1px solid #000; margin-top: 6px; padding-top: 6px; }
.ticket-prev .tp-type { font-size: 20px; font-weight: 800; margin-top: 4px; }
.ticket-prev .tp-foot { border-top: 1px solid #000; margin-top: 8px; padding-top: 6px; font-size: 11px; white-space: pre-line; }
.save-bar { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
@media (max-width: 1440px) { .top:has(.app-pick) .main-nav a span { display: none; } .top:has(.app-pick) .main-nav a { padding: 8px 10px; } }
/* Barre du haut : icônes seules dès que la place manque */
@media (max-width: 1240px) { .main-nav a span { display: none; } .main-nav a { padding: 8px 10px; } .hide-sm { display: none; } }
/* Petits écrans : la première colonne des tableaux reste visible quand on fait défiler */
@media (max-width: 700px) {
  .table-wrap th:first-child, .table-wrap td:first-child { position: sticky; left: 0; z-index: 1; background: var(--card); box-shadow: 1px 0 0 var(--line); max-width: 46vw; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .tabs a { white-space: nowrap; }
}
fieldset.plain { border: 0; padding: 0; margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
fieldset.plain:disabled .card { opacity: .8; }
.banner { border-radius: 12px; padding: 12px 16px; font-size: 14px; line-height: 1.5; }
.banner strong { display: block; margin-bottom: 2px; }
.banner.info { background: var(--info-bg); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); }
select[multiple] { padding: 6px; }
.tag.seen { color: var(--ok); background: var(--ok-bg); }
.seg-mini a.locked { opacity: .55; }
.seg-mini a.locked svg { vertical-align: -1px; }
.kpis-empty .kpi { opacity: .55; }
.msg-card.important { border-color: color-mix(in srgb, var(--err) 55%, var(--line)); }
.msg-card.important h2 { color: var(--err); }

/* Comparatif des offres */
table.compare { width: 100%; border-collapse: separate; border-spacing: 0; }
table.compare th, table.compare td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: center; vertical-align: top; }
table.compare th:first-child, table.compare td:first-child { text-align: left; }
table.compare thead th { font-size: 15px; }
table.compare .price { font-size: 20px; font-weight: 900; }
table.compare th.cur { box-shadow: inset 0 3px 0 var(--violet); }
table.compare th.best { background: var(--card2); box-shadow: inset 0 3px 0 var(--gold); border-radius: 12px 12px 0 0; }
.card.saving { border-color: var(--gold); }
.saving-line { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 8px; color: var(--text); }
.saving-line svg { color: var(--gold); flex: none; margin-top: 2px; }
.tpl-list { display: grid; gap: 8px; }
.tpl-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.tpl-item .tpl-txt { flex: 1; min-width: 0; }
.tpl-item .tpl-txt small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-item form { margin: 0; }
table.compare thead th { text-transform: none; letter-spacing: 0; color: var(--text); }
.card.saving td.r { white-space: nowrap; }
.grid-main > *, .tpl-list > * { min-width: 0; }
.tpl-item { flex-wrap: wrap; }
.tpl-item .tpl-txt { flex: 1 1 180px; }
.banner.trial { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 16px; background: var(--info-bg); border: 1px solid var(--gold); }
.banner.trial strong { flex: 1 0 100%; margin: 0; }
.banner.trial span { flex: 1 1 320px; color: var(--muted); }
.banner.trial .btn { flex: none; }
.sess { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; cursor: help; vertical-align: 1px; }
.sub-total { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--card2); border: 1px solid var(--line); }
.sub-total strong { font-size: 20px; font-weight: 900; }
.err-ink { color: var(--err); }
.req-list { display: grid; gap: 12px; margin-bottom: 16px; }
.card.req { border-color: var(--gold); }
.card.highlight { border-color: var(--gold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 25%, transparent); }
.msg-card.bloquant { border-color: var(--err); box-shadow: inset 4px 0 0 var(--err); }
.role-opt.opt-block:has(input:checked) { border-color: var(--err); }
.role-opt strong svg { vertical-align: -2px; }

/* Mode d'affichage simple */
body.mode-simple .d-only { display: none; }
.kpis.kpis-simple { grid-template-columns: repeat(3, 1fr); }
.kpis.kpis-simple .kpi-n { font-size: clamp(34px, 6vw, 56px); }
@media (max-width: 640px) { .kpis.kpis-simple { grid-template-columns: 1fr 1fr; } .kpis.kpis-simple > :first-child { grid-column: 1 / -1; } }
.simple-alert { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding: 12px 16px; border-radius: 14px; background: var(--warn-bg); color: var(--text); border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); text-decoration: none; }
.simple-alert > svg:first-child { color: var(--warn); flex: none; }
.simple-alert span { flex: 1; min-width: 0; }
.simple-foot { margin-top: 14px; }
.mode-switch .nav-ico { display: inline-flex; flex-direction: row; align-items: center; gap: 6px; width: auto; padding: 0 10px; }
.mode-lbl { font-size: 13px; font-weight: 600; }
@media (max-width: 900px) { .mode-lbl { display: none; } .mode-switch .nav-ico { padding: 0; width: 36px; } }
.card.danger-zone { border-color: color-mix(in srgb, var(--err) 45%, var(--line)); }
.card.danger-zone summary { cursor: pointer; }
.card.danger-zone[open] summary { margin-bottom: 8px; }

/* Inscription et profil */
main.narrow:has(form.signup), main.narrow:has(.signup-wide) { max-width: 720px; padding-top: 4vh; }
.row3 { display: grid; grid-template-columns: 1fr 2fr 1.3fr; gap: 0 14px; }
@media (max-width: 600px) { .row3 { grid-template-columns: 1fr; } }
form fieldset { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
form fieldset legend { font-weight: 800; font-size: 15px; padding: 0; margin-bottom: 2px; color: var(--text); }
form fieldset[hidden] { display: none; }
.fld { min-width: 0; }
.fld-err { display: block; color: var(--err); font-size: 13px; margin-top: 3px; }
.fld.has-err input, .fld.has-err select { border-color: var(--err); }
label.check.has-err { color: var(--err); }
.profile-kv dd { word-break: break-word; }
.diff-table td:nth-child(2) { color: var(--muted); text-decoration: line-through; }
.diff-table td:nth-child(3) { font-weight: 600; }
.danger-ink { color: var(--err); cursor: pointer; }
.mail-preview { white-space: pre-wrap; font: 14px/1.5 inherit; font-family: inherit; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin: 10px 0; color: var(--text); max-height: 260px; overflow: auto; }
.legal h2 { margin-top: 26px; } .legal li { margin: 6px 0; }
.apk-qr { display: flex; gap: 16px; align-items: flex-start; margin-top: 10px; flex-wrap: wrap; }
.apk-qr .qr { background: #fff; padding: 8px; border-radius: 10px; line-height: 0; flex: none; }
.apk-qr .qr img, .apk-qr .qr canvas { display: block; }
.apk-qr ol { margin: 0; padding-left: 18px; flex: 1 1 180px; } .apk-qr li { margin: 4px 0; }
.apk-qr .qr { width: 150px; height: 150px; } .apk-qr .qr svg { width: 100%; height: 100%; display: block; }

/* bandeaux d'avertissement */
.banner.warn { background: var(--warn-bg); border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--line)); }
.banner.err { background: var(--err-bg); border: 1px solid color-mix(in srgb, var(--err) 35%, var(--line)); }
/* page de contact (night-ticket.com) */
.contact-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.contact-form .r-first label { margin-top: 0; }
@media (max-width: 600px) { .contact-form .row2 { grid-template-columns: 1fr; } .contact-form .r-first .fld + .fld label { margin-top: 14px; } }
.contact-form textarea { min-height: 170px; resize: vertical; }
.contact-form .count { float: right; font-weight: 400; }
.rgpd-note { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 12px 0 0; }
.legal-page h2 { margin-top: 26px; font-size: 19px; } .legal-page li { margin: 6px 0; } .legal-page address { font-style: normal; }
.l-foot nav { flex-wrap: wrap; }
