/* CultConnect — feuille de style principale. Aucune police ni ressource externe. */
[hidden] { display: none !important; }
:root {
  --ink: #1b2233;
  --ink-2: #4a5263;
  --ink-3: #7b8394;
  --paper: #f5f3ee;
  --card: #ffffff;
  --line: #e4e0d7;
  --line-2: #efece5;
  --brand: #1f3157;
  --brand-2: #2c4579;
  --brand-ink: #ffffff;
  --gold: #b0863a;
  --gold-soft: #f4ead6;
  --ok: #2f7a4e; --ok-bg: #e5f2ea;
  --wait: #9a6a12; --wait-bg: #fbf0d8;
  --bad: #9b2c3a; --bad-bg: #f8e4e6;
  --info: #2c5f8a; --info-bg: #e3eef7;
  --muted-bg: #eeece7;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(27, 34, 51, .06), 0 4px 16px rgba(27, 34, 51, .05);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--sans); color: var(--ink); background: var(--paper); }
a { color: var(--brand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; margin: 0; }
h1 { font-size: 1.75rem; line-height: 1.2; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 .8em; }
small, .small { font-size: .85rem; }
.muted { color: var(--ink-3); }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
code, .mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: .88em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.2rem 0; }

/* ---------- Structure ---------- */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--brand); color: #dfe5f2; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side-head { padding: 20px 20px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-family: var(--serif); font-size: 1.22rem; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.tenant-name { margin-top: 10px; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: #aeb9d1; }
.nav { padding: 12px 10px; flex: 1; }
.nav-label { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #8d9ab8; padding: 14px 12px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: #dfe5f2; padding: 8px 12px; border-radius: 8px; font-size: .93rem; }
.nav a:hover { background: rgba(255,255,255,.07); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.13); color: #fff; box-shadow: inset 3px 0 0 var(--gold); }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side-foot { padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: .8rem; color: #aeb9d1; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--ink-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); display: grid; place-items: center; font-weight: 600; font-size: .78rem; }
.menu-btn { display: none; background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink); }
.content { padding: 26px 28px 60px; max-width: 1280px; width: 100%; }
.demo-banner { background: var(--gold-soft); color: #6b4f1a; font-size: .84rem; padding: 7px 28px; border-bottom: 1px solid #ead9b6; }
.demo-banner strong { color: #5a4013; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.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); box-shadow: var(--shadow); padding: 18px 20px; }
.card + .card { margin-top: 16px; }
.grid > .card + .card, .grid > * + .card { margin-top: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-head h2 { font-size: 1.05rem; }
.card.flush { padding: 0; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stack > * + * { margin-top: 16px; }

.kpi { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.kpi-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.kpi-value { font-family: var(--serif); font-size: 1.75rem; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi-sub { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.delta-up { color: var(--ok); }
.delta-down { color: var(--bad); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfaf7; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fcfbf8; }
.table .row-link { color: inherit; font-weight: 500; }
.card.flush .table th:first-child, .card.flush .table td:first-child { padding-left: 20px; }
.card.flush .table th:last-child, .card.flush .table td:last-child { padding-right: 20px; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 99px; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-wait { background: var(--wait-bg); color: var(--wait); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-muted { background: var(--muted-bg); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tag { display: inline-block; font-size: .74rem; padding: 1px 8px; border-radius: 6px; background: #f1efe9; color: var(--ink-2); }

/* ---------- Formulaires ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 .88rem var(--sans); padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { background: #f8f6f1; text-decoration: none; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn-danger { color: var(--bad); border-color: #e9c3c8; }
.btn-danger:hover { background: var(--bad-bg); }
.btn-sm { padding: 5px 10px; font-size: .8rem; }
.btn-lg { padding: 12px 20px; font-size: 1rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.form { display: grid; gap: 14px; }
.form-row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
label { display: block; font-size: .84rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; font-weight: 400; }
input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=tel], input[type=search], input[type=url], select, textarea {
  width: 100%; font: inherit; font-size: .93rem; padding: 9px 11px; border: 1px solid #d6d1c6; border-radius: 8px; background: #fff; color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; color: var(--ink); font-size: .9rem; }
.check input { margin-top: 3px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 14px; }
.toolbar .f { min-width: 150px; }
.toolbar label { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.toolbar input, .toolbar select { padding: 7px 10px; font-size: .88rem; }

.flash { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; font-size: .92rem; border: 1px solid; }
.flash-ok { background: var(--ok-bg); border-color: #bfe0cc; color: #1f5636; }
.flash-bad { background: var(--bad-bg); border-color: #ecc4c9; color: #7a1f2b; }
.flash-info { background: var(--info-bg); border-color: #c4d9eb; color: #1f4466; }
.callout { background: #faf8f3; border: 1px dashed #d9cfb9; border-radius: 8px; padding: 12px 14px; font-size: .88rem; color: var(--ink-2); }
.callout strong { color: var(--ink); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: .92rem; }
.tabs a.active { color: var(--brand); border-color: var(--gold); font-weight: 600; }
.tabs a:hover { text-decoration: none; color: var(--brand); }

.pager { display: flex; gap: 14px; align-items: center; justify-content: flex-end; padding: 12px 20px; font-size: .86rem; color: var(--ink-3); }

.progress { height: 8px; background: #efece5; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 99px; }
.progress.gold > span { background: var(--gold); }

dl.meta { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0; font-size: .92rem; }
dl.meta dt { color: var(--ink-3); }
dl.meta dd { margin: 0; }

/* ---------- Graphiques ---------- */
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: #ece8df; stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--sans); }
.chart .bar { fill: var(--brand); }
.chart .bar:hover { fill: var(--gold); }
.chart .bar-prev { fill: #d9dfeb; }
.legend { display: flex; gap: 16px; font-size: .8rem; color: var(--ink-3); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.hbars { display: grid; gap: 9px; }
.hbar { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'l v' 't t'; gap: 3px 10px; align-items: center; font-size: .86rem; }
.hbar-label { grid-area: l; } .hbar-val { grid-area: v; } .hbar-track { grid-area: t; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.hbar-track { height: 9px; background: #efece5; border-radius: 99px; overflow: hidden; }
.hbar-fill { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.hbar-val { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 64px; text-align: right; }

.alert-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.alert-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .88rem; padding: 10px 12px; border-radius: 8px; background: var(--wait-bg); color: #6b4a0e; }
.alert-list li.bad { background: var(--bad-bg); color: #7a1f2b; }
.alert-list li.ok { background: var(--ok-bg); color: #1f5636; }

.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.device { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
.device h3 { font-family: var(--sans); font-size: .95rem; font-weight: 600; }
.code-big { font: 600 2rem/1 ui-monospace, Menlo, monospace; letter-spacing: .18em; color: var(--brand); padding: 14px 0; }
.qr-box svg { width: 100%; max-width: 220px; height: auto; display: block; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 10px 0 10px 18px; border-left: 2px solid var(--line); position: relative; font-size: .9rem; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 15px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--gold); }

/* ---------- Pages publiques ---------- */
.pub { min-height: 100vh; display: flex; flex-direction: column; }
.pub-head { background: var(--brand); color: #fff; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pub-head .logo { font-size: 1.1rem; }
.pub-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 18px 60px; }
.pub-main.wide { max-width: 1120px; }
.pub-foot { text-align: center; font-size: .8rem; color: var(--ink-3); padding: 18px; }
.hero { background: radial-gradient(1200px 400px at 20% -10%, #2c4579 0%, transparent 60%), var(--brand); color: #fff; padding: 64px 24px 72px; }
.hero-in { max-width: 1120px; margin: 0 auto; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); max-width: 18ch; }
.hero p.lead { font-size: 1.15rem; color: #d3dbec; max-width: 56ch; margin-top: 14px; }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); font-weight: 600; }
.feature { display: grid; gap: 6px; }
.feature h3 { font-family: var(--sans); font-size: 1rem; font-weight: 600; }
.feature p { color: var(--ink-2); font-size: .92rem; margin: 0; }
.amounts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.amounts label { margin: 0; }
.amounts input { position: absolute; opacity: 0; pointer-events: none; }
.amounts span { display: block; text-align: center; padding: 14px 6px; border: 1.5px solid #d6d1c6; border-radius: 10px; font: 600 1.1rem var(--serif); color: var(--ink); cursor: pointer; background: #fff; }
.amounts input:checked + span { border-color: var(--brand); background: #eef2fa; box-shadow: 0 0 0 2px var(--brand) inset; }
.amounts input:focus-visible + span { outline: 2px solid var(--gold); }
.ticket { border: 1px dashed #cbbf9f; border-radius: 14px; padding: 22px; background: #fffdf8; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }

/* ---------- Connexion ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art { background: var(--brand); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::after { content: ""; position: absolute; right: -160px; bottom: -160px; width: 480px; height: 480px; border-radius: 50%; border: 1px solid rgba(176,134,58,.35); box-shadow: 0 0 0 40px rgba(176,134,58,.06), 0 0 0 80px rgba(176,134,58,.04); }
.auth-art h1 { font-size: 2.3rem; max-width: 16ch; }
.auth-art p { color: #c8d1e4; max-width: 44ch; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-box { width: 100%; max-width: 400px; }
.demo-accounts { margin-top: 22px; font-size: .84rem; }
.demo-accounts table { width: 100%; border-collapse: collapse; }
.demo-accounts td { padding: 5px 0; border-bottom: 1px solid var(--line-2); }
.demo-accounts button { font: inherit; background: none; border: 0; color: var(--brand-2); cursor: pointer; padding: 0; text-align: left; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-2-1 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .2s ease; z-index: 20; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .menu-btn { display: inline-flex; }
  .hide-sm { display: none !important; }
  .content, .top { padding-left: 16px; padding-right: 16px; }
  .demo-banner { padding-left: 16px; padding-right: 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 20px; }
  .auth-art h1 { font-size: 1.6rem; }
}
@media (max-width: 560px) { .g4 { grid-template-columns: 1fr 1fr; } .kpi-value { font-size: 1.4rem; } .ticket { grid-template-columns: 1fr; } }
@media print {
  .side, .top, .demo-banner, .actions, .toolbar, .no-print, .pager { display: none !important; }
  .app { display: block; } .content { padding: 0; max-width: none; } body { background: #fff; }
  .card { box-shadow: none; border: 0; padding: 0; }
}
