/* Nos Clichés — administration */
:root {
  --night: #0F0E11;
  --night-3: #1F1C23;
  --line-dark: #3A3640;
  --paper: #F4EFE8;
  --bg: #F4F2EF;
  --card: #FFFFFF;
  --border: #E6E2DD;
  --border-2: #D9D4CE;
  --row: #EFECE8;
  --text: #0F0E11;
  --muted: #6B6570;
  --ink-soft: #4A4550;
  --pink: #FF5C8A;
  --pink-ink: #C8235A;
  --lemon: #F2FF6B;
  --danger: #A3133F;
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--pink-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* Mise en page */
.shell { min-height: 100vh; display: flex; }
.side { width: 248px; flex: none; background: var(--night); color: var(--paper); padding: 24px 16px; display: flex; flex-direction: column; gap: 28px; position: sticky; top: 0; height: 100vh; }
.brand { color: var(--paper); display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 800; font-size: 20px; padding: 0 10px; white-space: nowrap; }
.brand:hover { color: var(--paper); }
.brand .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--pink); }
.brand .tag { font-family: var(--body); font-size: 11px; font-weight: 600; color: var(--night); background: var(--lemon); padding: 2px 6px; border-radius: 4px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { color: #C9C3CE; padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.side nav a:hover { background: var(--night-3); color: var(--paper); }
.side nav a[aria-current="page"] { background: var(--paper); color: var(--night); }
.side nav .badge { color: var(--lemon); font-weight: 700; }
.side nav a[aria-current="page"] .badge { color: var(--pink-ink); }
.side .foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.storage { padding: 12px; border-radius: 12px; background: var(--night-3); font-size: 13px; color: #A39DA8; }
.storage .bar { height: 6px; border-radius: 3px; background: var(--line-dark); margin: 8px 0 6px; overflow: hidden; }
.storage .bar span { display: block; height: 100%; background: var(--pink); border-radius: 3px; }
.side .me { font-size: 13px; color: #A39DA8; padding: 0 10px; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.side .me button { background: none; border: 0; color: #C9C3CE; text-decoration: underline; padding: 6px 0; font-size: 13px; }
.main { flex: 1; min-width: 0; padding: 28px 32px 64px; display: flex; flex-direction: column; gap: 24px; }
.topbar { display: none; }
@media (max-width: 900px) {
  .shell { flex-direction: column; }
  .side { width: auto; height: auto; position: static; padding: 14px 16px; gap: 12px; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .side nav a { padding: 10px 12px; white-space: nowrap; gap: 8px; }
  .side .foot { display: none; }
  .main { padding: 20px 16px 48px; }
}

/* Éléments */
.page-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; }
.page-head h1 { font-size: 34px; font-weight: 800; overflow-wrap: anywhere; }
.page-head .sub { color: var(--muted); font-size: 15px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.row-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--card); color: var(--text); font-weight: 600; font-size: 14px; white-space: nowrap; text-align: center; }
.btn:hover { border-color: var(--muted); color: var(--text); }
.btn-dark { background: var(--night); border-color: var(--night); color: var(--paper); }
.btn-dark:hover { color: var(--lemon); border-color: var(--night); }
.btn-pink { background: var(--pink); border-color: var(--pink); color: var(--night); }
.btn-pink:hover { color: var(--night); filter: brightness(1.05); border-color: var(--pink); }
.btn-danger { color: var(--danger); border-color: #F3B7C8; }
.btn-danger:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-link { border: 0; background: none; padding: 0; color: var(--pink-ink); font-weight: 600; text-decoration: underline; min-height: 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card h2 { font-size: 20px; font-weight: 700; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; }
.card-head a { font-size: 14px; font-weight: 600; color: var(--pink-ink); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: #DDF7EC; color: #0B6B48; }
.pill.wait { background: #FFF4C2; color: #7A5A00; }
.pill.draft { background: var(--row); color: var(--ink-soft); }
.pill.off { background: #FFE3EB; color: var(--danger); }
.pill.live { background: var(--night); color: var(--lemon); }
code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--bg); padding: 4px 8px; border-radius: 6px; }
.flash { padding: 14px 18px; border-radius: 12px; font-weight: 600; display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.flash.ok { background: #DDF7EC; color: #0B6B48; }
.flash.error { background: #FFE3EB; color: var(--danger); }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.col-main { flex: 3 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.col-side { flex: 2 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { background: var(--card); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); }
.kpi .label { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .value { font-family: var(--display); font-size: 36px; font-weight: 800; line-height: 1.1; }
.kpi .sub { font-size: 13px; color: var(--muted); }

/* Listes */
.event-row { display: flex; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--row); }
.datebox { width: 52px; flex: none; text-align: center; border-radius: 10px; background: var(--bg); padding: 6px 0; }
.datebox b { display: block; font-family: var(--display); font-weight: 800; font-size: 20px; line-height: 1; }
.datebox small { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.event-row .info { flex: 1; min-width: 0; }
.event-row .info p:first-child { font-weight: 600; }
.req { border: 1px solid var(--row); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.req .who { font-weight: 600; }
.empty-line { color: var(--muted); font-size: 14px; padding: 12px 0; border-top: 1px solid var(--row); }

/* Tableau */
.table-wrap { overflow-x: auto; margin: 0 -24px -24px; }
table { width: 100%; border-collapse: collapse; }
th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 14px 16px; border-bottom: 1px solid var(--row); font-size: 14px; white-space: nowrap; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #FBFAF8; }
.g-cell { display: flex; align-items: center; gap: 12px; }
.g-thumb { width: 36px; height: 44px; border-radius: 6px; flex: none; background: var(--row); object-fit: cover; }
.g-cell a { font-weight: 600; }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; min-width: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=file]), .field select, .field textarea {
  font-size: 15px; font-weight: 400; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border-2); background: #fff; color: var(--text); width: 100%; min-height: 46px;
}
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus { border-color: var(--night); outline: none; box-shadow: 0 0 0 3px rgba(255,92,138,.25); }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.grid-fields .full { grid-column: 1 / -1; }
.code-field input { font-family: var(--display) !important; font-weight: 700 !important; letter-spacing: .08em; font-size: 18px !important; text-transform: uppercase; }
.switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--row); cursor: pointer; }
.switch-row .t { font-weight: 600; font-size: 15px; }
.switch-row .h { font-size: 13px; color: var(--muted); }
.switch { position: relative; flex: none; width: 52px; height: 30px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--border-2); transition: background .15s; pointer-events: none; }
.switch span::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + span { background: var(--night); }
.switch input:checked + span::after { transform: translateX(22px); }
.switch input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { position: relative; width: 40px; height: 40px; }
.swatch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.swatch span { position: absolute; inset: 0; border-radius: 50%; border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); pointer-events: none; }
.swatch input:checked + span { border-color: var(--night); box-shadow: inset 0 0 0 3px #fff; }
.swatch input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.color-custom { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--muted); }
.color-custom input[type=color] { width: 44px; height: 40px; padding: 2px; border: 1px solid var(--border-2); border-radius: 8px; background: #fff; }
.brand-slot { display: flex; gap: 14px; align-items: center; padding: 14px; border: 1px solid var(--row); border-radius: 12px; flex-wrap: wrap; }
.brand-slot .preview { width: 120px; height: 72px; border-radius: 8px; background: var(--bg) center / cover no-repeat; flex: none; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; overflow: hidden; }
.brand-slot .preview.logo { background-size: contain; background-color: var(--night); }
.brand-slot .meta { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 6px; }
.brand-slot .meta strong { font-size: 14px; }
.brand-slot input[type=file] { font-size: 13px; max-width: 100%; }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 500; }
.savebar { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, rgba(244,242,239,0)); }

/* Photos (admin) */
.dropzone { border: 2px dashed var(--border-2); border-radius: 14px; padding: 28px 24px; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; text-align: center; color: var(--ink-soft); transition: border-color .15s, background .15s; }
.dropzone.is-over { border-color: var(--pink); background: #FFF0F4; }
.dropzone label { color: var(--pink-ink); font-weight: 600; text-decoration: underline; cursor: pointer; }
.progress { height: 8px; border-radius: 4px; background: var(--row); overflow: hidden; width: 100%; max-width: 420px; }
.progress span { display: block; height: 100%; width: 0; background: var(--pink); transition: width .2s; }
.photo-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.photo-tools .filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-2); background: #fff; font-size: 13px; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--night); color: var(--paper); border-color: var(--night); }
.bulk { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--night); color: var(--paper); }
.bulk .btn { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 8px; }
.bulk .count { font-weight: 600; font-size: 14px; margin-right: auto; }
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.ph { position: relative; aspect-ratio: 3 / 4; border-radius: 8px; overflow: hidden; background: var(--row); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph.is-hidden img { opacity: .3; }
.ph label { position: absolute; inset: 0; cursor: pointer; }
.ph input { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; margin: 0; accent-color: var(--pink); cursor: pointer; z-index: 1; }
.ph input:checked ~ .ring { box-shadow: inset 0 0 0 3px var(--pink); }
.ph .ring { position: absolute; inset: 0; border-radius: 8px; pointer-events: none; }
.ph .badges { position: absolute; left: 6px; right: 6px; bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px; pointer-events: none; }
.ph .b { font-size: 10px; font-weight: 700; background: var(--night); color: var(--paper); border-radius: 5px; padding: 2px 6px; }
.ph .b.pend { background: var(--lemon); color: var(--night); }
.ph .b.guest { background: #fff; color: var(--night); }
.ph .zoom { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: rgba(15,14,17,.75); color: #fff; display: flex; align-items: center; justify-content: center; z-index: 1; }

/* Partage */
.qr-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.qr-box .qr { width: 132px; height: 132px; flex: none; border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: #fff; }
.qr-box .qr svg { width: 100%; height: 100%; display: block; }
.qr-box .link { font-size: 14px; font-weight: 600; word-break: break-all; }
.guest-preview { background: var(--night); color: var(--paper); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.guest-preview .k { font-size: 12px; font-weight: 600; color: var(--lemon); text-transform: uppercase; letter-spacing: .05em; }
.guest-preview .t { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.guest-preview .banner { aspect-ratio: 21 / 8; border-radius: 10px; background: center / cover no-repeat; }
.guest-preview .mini { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.guest-preview .mini span { aspect-ratio: 3 / 4; border-radius: 6px; background: center / cover no-repeat #2B2732; }
.guest-preview a { color: var(--paper); text-decoration: underline; font-size: 14px; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats div { background: var(--bg); border-radius: 10px; padding: 10px; }
.stats b { display: block; font-family: var(--display); font-size: 22px; }
.stats small { color: var(--muted); font-size: 12px; }

/* Modale photo */
.viewer { position: fixed; inset: 0; z-index: 50; background: rgba(15,14,17,.92); display: flex; align-items: center; justify-content: center; padding: 24px; }
.viewer img { max-width: 100%; max-height: 100%; border-radius: 10px; }
.viewer button { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; display: flex; align-items: center; justify-content: center; }

/* Connexion */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: var(--night); }
.auth .box { width: 100%; max-width: 420px; background: var(--card); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 20px; }
.auth .brand { color: var(--text); padding: 0; }
.auth h1 { font-size: 28px; font-weight: 800; }
.auth form { display: flex; flex-direction: column; gap: 14px; }
.auth .btn { width: 100%; min-height: 50px; }
.error-text { color: var(--danger); font-size: 14px; font-weight: 600; }

/* Demandes */
.req-card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr); gap: 20px; }
@media (max-width: 760px) { .req-card { grid-template-columns: 1fr; } }
.req-card dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: 14px; }
.req-card dt { color: var(--muted); }
.req-card dd { margin: 0; overflow-wrap: anywhere; }
.tabsbar { display: flex; gap: 6px; flex-wrap: wrap; }
.searchbox { display: flex; align-items: center; gap: 8px; padding: 0 14px; height: 44px; border-radius: 10px; background: #fff; border: 1px solid var(--border); color: var(--muted); }
.searchbox input { border: 0; outline: 0; font-size: 14px; width: 200px; background: transparent; color: var(--text); min-height: 0; padding: 0; }
.apikey { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.apikey code { font-size: 14px; padding: 10px 12px; word-break: break-all; flex: 1; min-width: 200px; }
pre.snippet { background: var(--night); color: var(--paper); border-radius: 12px; padding: 16px; overflow-x: auto; font-size: 13px; line-height: 1.6; margin: 0; }
