/* ---------- Back-office ---------- */
.adm { min-height: 100vh; background: var(--bg-alt); }
.adm-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg-alt); }
.adm-login .card { width: 100%; max-width: 400px; padding: 32px; }
.adm-login .brand { margin-bottom: 24px; }
.adm-top { position: sticky; top: 0; z-index: 40; background: #fff; border-bottom: 1px solid var(--border); }
.adm-top .bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 60px; }
.adm-top .brand small { font-weight: 600; color: var(--ink-3); font-size: 12px; background: var(--bg-mute); border-radius: 6px; padding: 2px 8px; margin-left: 4px; }
.adm-actions { display: flex; gap: 8px; }
.adm-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.adm-tabs::-webkit-scrollbar { display: none; }
.adm-tab { border: 0; background: none; padding: 12px 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: 15px; }
.adm-tab.active { color: var(--ink); border-color: var(--accent); }
.adm-main { padding: 24px 0 80px; }
.adm-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.adm-h h1 { margin: 0; font-size: 26px; }
.adm-h p { margin: 4px 0 0; color: var(--ink-3); font-size: 14px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { padding: 18px; }
.stat span { color: var(--ink-3); font-size: 13px; font-weight: 600; }
.stat strong { display: block; font-size: 30px; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.panel { padding: 20px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 16px; font-size: 17px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 18px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; min-width: 0; }
.bars .b i { display: block; width: 100%; max-width: 28px; background: var(--grad); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .b i[data-v]::after { content: attr(data-v); position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-size: 11px; font-style: normal; color: var(--ink-2); font-weight: 700; }
.bars .b small { font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.two-col { display: grid; gap: 20px; }
@media (min-width: 1000px) { .two-col { grid-template-columns: 1fr 1fr; } }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; color: var(--ink-3); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--bg-mute); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .muted { color: var(--ink-3); font-size: 13px; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.ibtn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: #fff; display: inline-grid; place-items: center; cursor: pointer; font-size: 15px; }
.ibtn:hover { border-color: var(--accent); color: var(--accent); }
.ibtn.danger:hover { border-color: #DC2626; color: #DC2626; }
.thumb { width: 54px; height: 40px; border-radius: 8px; background: var(--ink); overflow: hidden; flex: none; position: relative; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.ph::after { content: ''; position: absolute; left: 30%; right: 10%; top: 30%; bottom: 20%; background: var(--grad); transform: skewX(-12deg); }
.name-cell { display: flex; align-items: center; gap: 12px; font-weight: 700; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--bg-mute); }
.pill.on { background: var(--soft); color: var(--accent); }
.pill.off { background: #FEE2E2; color: #B91C1C; }
.switch { position: relative; width: 44px; height: 26px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.check-row { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; }
.drawer-bg { position: fixed; inset: 0; background: rgba(10,10,10,.4); z-index: 90; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(640px, 100%); background: #fff; z-index: 91; display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.1); animation: slide .25s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.drawer-h h2 { margin: 0; font-size: 19px; }
.drawer-b { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; gap: 10px; justify-content: flex-end; background: #fff; }
.date-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 8px; position: relative; background: var(--bg-alt); }
@media (min-width: 560px) { .date-row { grid-template-columns: 150px 1fr 1.3fr 36px; align-items: center; } }
.date-row .input { min-height: 42px; padding: 8px 10px; font-size: 15px; }
.img-field { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.img-prev { width: 140px; aspect-ratio: 16/11; border-radius: 10px; overflow: hidden; background: var(--ink); border: 1px solid var(--border); flex: none; position: relative; }
.img-prev img { width: 100%; height: 100%; object-fit: cover; }
.img-prev.ph::after { content: 'Visuel auto'; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; background: radial-gradient(circle at 70% 20%, #4a1806, #0A0A0A); }
.img-ctrl { flex: 1; min-width: 200px; display: grid; gap: 8px; }
.help { font-size: 13px; color: var(--ink-3); margin-top: 6px; }
.kpi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.settings-grid { display: grid; gap: 20px; }
@media (min-width: 1000px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
.req-detail { font-size: 13px; color: var(--ink-2); max-width: 340px; }
.empty-sm { color: var(--ink-3); text-align: center; padding: 24px; font-size: 14px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar .input { max-width: 280px; min-height: 42px; }

/* Drawer large avec aperçu en direct de la vignette */
.drawer.wide { width: min(1080px, 100%); }
.drawer-split { flex: 1; min-height: 0; overflow-y: auto; }
.drawer-split .drawer-b { overflow: visible; }
.live { padding: 20px; background: var(--bg-alt); border-top: 1px solid var(--border); }
.live-h { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.live-h::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #22C55E; box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
#live-card { max-width: 360px; margin: 0 auto; }
#live-card a { pointer-events: none; }
@media (min-width: 900px) {
  .drawer-split { display: grid; grid-template-columns: 1fr 380px; overflow: hidden; }
  .drawer-split .drawer-b { overflow-y: auto; }
  .live { border-top: 0; border-left: 1px solid var(--border); overflow-y: auto; }
}
.img-prev { background: #FAFAFA; }
.img-prev img { object-fit: contain; }
.img-prev.ph::after { content: 'Aucun visuel'; color: var(--ink-3); background: #FAFAFA; }
.thumb { background: #FAFAFA; border: 1px solid var(--border); }
.thumb img { object-fit: contain; }
.thumb.ph::after { left: 25%; right: 25%; top: 30%; bottom: 30%; opacity: .25; }
