/* Administration — Mon Horizon Malin */
@font-face { font-family: "Nunito"; src: url("../../assets/fonts/nunito.woff2") format("woff2"); font-weight: 200 1000; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("../../assets/fonts/figtree.woff2") format("woff2"); font-weight: 300 900; font-display: swap; }

:root {
    --ink: #0A3D51; --plan: #01787B; --metre: #F49C32; --paper: #F6F5F0; --line: #DCE3E1; --muted: #4B6170;
    --green: #1F7A4D; --red: #B23A22; --blue: #1D5FA8; --white: #fff;
    --display: "Nunito", system-ui, sans-serif; --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
    --r: 8px; --side: 248px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.55 var(--body); color: var(--ink); background: var(--paper); }
a { color: var(--plan); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; font-weight: 800; }
p { margin: 0 0 .8em; }
code, .mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; }
code { background: #E9EEF4; padding: 1px 5px; border-radius: 4px; word-break: break-all; }
:focus-visible { outline: 3px solid var(--metre); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 10px; top: -50px; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 200; border-radius: 6px; }
.skip:focus { top: 10px; }
.muted { color: var(--muted); }
.small { font-size: .87rem; }
.nowrap { white-space: nowrap; }
.error-text { color: var(--red); }
.ok-text { color: var(--green); }
[hidden] { display: none !important; }

/* ---------- Structure ---------- */
.sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: var(--side); background: var(--ink); color: #C7D2DF; overflow-y: auto; z-index: 50; display: flex; flex-direction: column; }
.sidebar-brand { display: block; padding: 20px 20px 14px; }
.sidebar-brand img { width: 196px; height: auto; }
.sidebar nav { flex: 1; padding: 0 10px 20px; }
.sidebar ul { list-style: none; margin: 0 0 6px; padding: 0; }
.sidebar-group { font-size: .75rem; color: #8A9AB0; margin: 16px 12px 6px; font-weight: 600; }
.sidebar a { display: flex; align-items: center; justify-content: space-between; color: #DCE4EE; text-decoration: none; padding: 7px 12px; border-radius: 6px; font-weight: 500; }
.sidebar a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar a[aria-current] { background: var(--metre); color: var(--ink); font-weight: 700; }
.badge { background: var(--metre); color: var(--ink); font-size: .75rem; font-weight: 800; border-radius: 999px; padding: 1px 7px; }
.sidebar a[aria-current] .badge { background: var(--ink); color: #fff; }
.sidebar-version { font-size: .75rem; color: #7F90A6; padding: 10px 22px 16px; margin: 0; }
.admin-shell { margin-left: var(--side); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 28px; background: rgba(243, 246, 249, .92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle { display: none; margin-right: auto; background: none; border: 0; width: 40px; height: 40px; position: relative; cursor: pointer; }
.sidebar-toggle span:first-child, .sidebar-toggle span:first-child::before, .sidebar-toggle span:first-child::after { content: ""; position: absolute; left: 9px; right: 9px; height: 2px; background: var(--ink); }
.sidebar-toggle span:first-child { top: 19px; }
.sidebar-toggle span:first-child::before { top: -7px; left: 0; right: 0; }
.sidebar-toggle span:first-child::after { top: 7px; left: 0; right: 0; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 8px; border-radius: 999px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: #E3E9F0; }
.avatar-mini { width: 30px; height: 30px; border-radius: 50%; background: var(--plan); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.usermenu > div { position: absolute; right: 0; top: 110%; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 10px 30px rgba(10, 61, 81, .12); min-width: 190px; padding: 6px; }
.usermenu > div a, .usermenu > div button { display: block; width: 100%; text-align: left; padding: 8px 12px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; border-radius: 6px; cursor: pointer; }
.usermenu > div a:hover, .usermenu > div button:hover { background: var(--paper); }
.pill { padding: 4px 12px; border-radius: 999px; font-size: .85rem; font-weight: 700; text-decoration: none; }
.pill-warn { background: #FFE7D1; color: #8A3D00; }
.admin-main { padding: 26px 28px 60px; max-width: 1500px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; max-width: 80ch; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Composants ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 700 .93rem/1.2 var(--body); padding: 9px 16px; border-radius: 7px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--plan); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn-danger { background: var(--red); color: #fff; }
.btn-link { background: none; border: 0; padding: 4px 6px; color: var(--plan); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.btn-link.btn-danger { background: none; color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: .86rem; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; }
.btn.is-busy::before { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn-icon { background: none; border: 0; width: 32px; height: 32px; border-radius: 6px; font-size: 1.2rem; line-height: 1; cursor: pointer; color: var(--muted); flex-shrink: 0; }
.btn-icon:hover { background: var(--paper); color: var(--ink); }

.box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 20px 22px; margin-bottom: 20px; }
.box-highlight { border-color: var(--metre); box-shadow: 0 0 0 3px #FFE7D1; }
.box-title { font-size: 1.12rem; margin-bottom: 14px; }
.box-subtitle { font-size: 1rem; margin-top: 18px; }
.box-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.box-head .box-title { margin: 0; }
.narrow-box { max-width: 820px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 20px; }
.panel h2 { font-size: 1.05rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; }
.panel-start { border-left: 4px solid var(--metre); }
.start-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 24px; }
.start-list li { display: flex; gap: 10px; align-items: center; }
.tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 800; flex-shrink: 0; }
.start-list .is-done { color: var(--muted); }
.start-list .is-done .tick { background: var(--green); border-color: var(--green); color: #fff; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 16px; }
.grid-wide-left { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.dash-grid { gap: 0 20px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; }
a.stat:hover { border-color: var(--ink); }
.stat-value { font: 800 1.7rem/1.1 var(--display); }
.stat-label { color: var(--muted); font-size: .87rem; }
.mini-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.mini-stats strong { display: block; font: 800 1.35rem var(--display); }
.mini-stats span { color: var(--muted); font-size: .85rem; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 70px; margin: 8px 0 14px; padding-bottom: 2px; border-bottom: 1px solid var(--line); }
.bars-tall { height: 140px; }
.bars span { flex: 1; background: var(--plan); border-radius: 2px 2px 0 0; min-height: 2px; }
.bars span:hover { background: var(--metre); }

/* Formulaires */
.field { margin-bottom: 14px; position: relative; }
.field > label, fieldset legend, label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=search], input[type=number], input[type=date], input[type=datetime-local], input:not([type]), select, textarea {
    width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: 7px; padding: 8px 11px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--plan); box-shadow: 0 0 0 3px rgba(1, 120, 123, .15); }
input[type=color] { width: 70px; height: 40px; padding: 2px; border: 1.5px solid var(--line); border-radius: 7px; background: #fff; }
label input, label textarea, label select { margin-top: 5px; font-weight: 400; }
label.inline, .field-check label { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; }
label.inline input, .field-check input { width: auto; margin-top: 3px; }
.help { display: block; color: var(--muted); font-size: .83rem; margin-top: 4px; font-weight: 400; }
.counter { position: absolute; right: 0; top: 0; font-size: .78rem; color: var(--muted); }
.counter.is-over { color: var(--red); font-weight: 700; }
.counter.is-low { color: #9A6100; }
.field-check { margin-bottom: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 16px 0 0; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 10px; }
.inline { display: inline; }
.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1; min-width: 200px; margin-bottom: 0; }
.inline-actions { display: flex; gap: 12px; align-items: flex-end; }
.inline-actions .field { margin-bottom: 0; }
.input-xs { width: 70px !important; padding: 4px 8px !important; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.filters input, .filters select { width: auto; min-width: 180px; }
.filters-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.more summary { cursor: pointer; font-weight: 600; margin: 4px 0 12px; color: var(--plan); }
fieldset.choice { border: 0; padding: 0; margin: 12px 0; }
.choice-card { display: grid !important; grid-template-columns: auto 1fr; gap: 2px 10px; border: 1.5px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 8px; cursor: pointer; font-weight: 400 !important; }
.choice-card input { grid-row: span 2; margin-top: 4px; width: auto; }
.choice-card span { color: var(--muted); font-size: .88rem; }
.choice-card:has(input:checked) { border-color: var(--plan); background: #F1F6FB; }

/* Tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.box .table-wrap { border: 0; border-radius: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .8rem; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #FAFBFD; }
.box .table th { background: none; }
.table td { padding: 11px 12px; border-bottom: 1px solid #EDF1F5; vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #FAFBFD; }
.table tr.is-current td { background: #FFF5EC; }
.table-compact td, .table-compact th { padding: 7px 8px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums; }
.col-check { width: 36px; }
.row-title { font-weight: 700; color: var(--ink); text-decoration: none; }
.row-title:hover { color: var(--plan); text-decoration: underline; }
.row-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 3px; font-size: .82rem; }
.row-actions { font-size: .85rem; margin-top: 3px; opacity: .0; transition: opacity .1s; }
.row-actions a { margin-right: 10px; }
tr:hover .row-actions, .row-actions:focus-within { opacity: 1; }
.row-btns { text-align: right; white-space: nowrap; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .75rem; font-weight: 700; background: #E6ECF3; color: var(--ink); }
.chip-orange { background: #FFE7D1; color: #8A3D00; }
.chip-red { background: #FBE3DD; color: var(--red); }
.chip-float { position: absolute; top: 6px; left: 6px; }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.status-green { background: #DDF2E6; color: var(--green); }
.status-blue { background: #DDEAF8; color: var(--blue); }
.status-grey { background: #E9EDF2; color: var(--muted); }
.bulk-bar { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.bulk-bar select { width: auto; }
.pager { display: flex; gap: 4px; margin-top: 16px; flex-wrap: wrap; }
.pager a { padding: 5px 11px; border: 1px solid var(--line); border-radius: 6px; text-decoration: none; background: #fff; }
.pager a[aria-current] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; flex-wrap: wrap; }
.tabs-scroll { flex-wrap: nowrap; overflow-x: auto; }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--metre); }
.count { background: #E6ECF3; border-radius: 999px; padding: 0 7px; font-size: .78rem; margin-left: 4px; }
.empty-state { background: #fff; border: 1.5px dashed var(--line); border-radius: 10px; padding: 40px; text-align: center; }

.notice { padding: 11px 15px; border-radius: 8px; margin-bottom: 14px; border-left: 4px solid; background: #fff; }
.notice p:last-child, .notice ol:last-child { margin-bottom: 0; }
.notice-success { border-color: var(--green); background: #EBF6F0; }
.notice-error { border-color: var(--red); background: #FBEDE9; }
.notice-info { border-color: var(--blue); background: #EBF2FA; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 0 0 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }
.checklist { list-style: none; padding: 0; margin: 0 0 16px; }
.checklist li { padding: 3px 0; }
.checklist .ok { color: var(--green); }
.checklist .ko { color: var(--red); font-weight: 700; }
.howto { padding-left: 20px; }
.howto li { margin-bottom: 8px; }
.copyable { display: inline-block; padding: 6px 10px; }
.tips { padding-left: 18px; }
.tips li { margin-bottom: 6px; }

/* Toasts et modales */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 8px; max-width: 420px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); border-left: 4px solid var(--green); transition: opacity .3s, transform .3s; }
.toast-error { border-left-color: #FF8A6B; }
.toast.is-out { opacity: 0; transform: translateY(8px); }
.modal { position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 61, 81, .45); }
.modal-box { position: relative; background: #fff; border-radius: 12px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-wide .modal-box { max-width: 980px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 1.15rem; margin: 0; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.spinner { display: inline-block; width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--metre); border-radius: 50%; animation: spin .8s linear infinite; }
.ai-wait { text-align: center; padding: 30px; }
.ai-result { border: 1px solid var(--line); border-radius: 8px; padding: 16px; max-height: 55vh; overflow: auto; }
.pick-list { display: grid; gap: 6px; max-height: 50vh; overflow: auto; }
.pick { display: flex !important; gap: 8px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; font-weight: 400 !important; }
.pick input { width: auto; }
.sugg { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.sugg p { margin: 0; }
.sugg.is-done { opacity: .5; }

/* Médiathèque */
.mp-tools { display: flex; gap: 8px; margin-bottom: 10px; }
.mp-upload { cursor: pointer; }
.mp-ai { margin-bottom: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.mp-ai summary { cursor: pointer; font-weight: 700; }
.mp-ai-row { display: flex; gap: 8px; margin-top: 8px; }
.mp-drop { border: 2px dashed var(--line); border-radius: 8px; padding: 10px; text-align: center; color: var(--muted); margin-bottom: 10px; font-size: .9rem; }
.mp-drop.is-over, .dropzone.is-over { border-color: var(--metre); background: #FFF5EC; color: var(--ink); }
.mp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; max-height: 42vh; overflow: auto; }
.mp-item { aspect-ratio: 1; border: 2px solid transparent; border-radius: 6px; padding: 0; background: var(--paper); cursor: pointer; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.mp-item img { width: 100%; height: 100%; object-fit: cover; }
.mp-item.is-selected { border-color: var(--metre); box-shadow: 0 0 0 2px var(--metre); }
.mp-item.is-loading { color: var(--muted); }
.mp-detail { display: grid; grid-template-columns: 140px 1fr; gap: 14px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.mp-detail img { width: 140px; border-radius: 6px; }
.media-field-preview { width: 100%; min-height: 70px; border: 1.5px dashed var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; overflow: hidden; margin-bottom: 8px; background: var(--paper); }
.media-field-preview img { width: 100%; max-height: 180px; object-fit: cover; }
.media-field-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.dropzone { border: 2px dashed var(--line); border-radius: 10px; padding: 16px; text-align: center; color: var(--muted); margin-bottom: 16px; background: #fff; }
.media-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.media-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.media-thumb { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 4/3; background: var(--paper); font-weight: 800; color: var(--muted); text-decoration: none; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-info { padding: 10px 12px; }
.media-info p { margin: 0 0 4px; word-break: break-all; }
.alt-form { display: flex; gap: 4px; margin: 6px 0; }
.alt-form input { padding: 5px 8px; font-size: .85rem; }
.alt-form input.is-missing { border-color: #F2B48F; background: #FFF8F2; }
.media-actions { display: flex; justify-content: space-between; }

/* Messages */
.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-list li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); border-radius: 8px; }
.msg-list li a:hover { background: var(--paper); }
.msg-list .msg-subject, .msg-list li a > span:last-child { grid-column: 1 / -1; }
.msg-list .is-unread a { font-weight: 700; }
.msg-list .is-unread a::before { content: ""; position: absolute; }
.msg-list .is-current a { background: #FFF5EC; }
.msg-body { background: var(--paper); border-radius: 8px; padding: 14px 16px; white-space: normal; }

/* Génération IA */
.job-list { list-style: none; padding: 0; margin: 0; }
.job-list li { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #EDF1F5; font-size: .9rem; }
.job-status { font-size: .75rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: #E9EDF2; white-space: nowrap; align-self: flex-start; }
.job-done { background: #DDF2E6; color: var(--green); }
.job-writing, .job-pending { background: #DDEAF8; color: var(--blue); }
.job-outline_ready { background: #FFE7D1; color: #8A3D00; }
.job-error { background: #FBE3DD; color: var(--red); }
.idea-list { list-style: none; padding: 0; margin: 10px 0; }
.idea-list li { border-bottom: 1px solid #EDF1F5; padding: 8px 0; }
.idea-list label { display: grid !important; grid-template-columns: auto 1fr; gap: 0 8px; font-weight: 400; }
.idea-list label input { grid-row: span 3; width: auto; margin-top: 4px; }
.idea-list strong { font-weight: 700; }
.audit summary { cursor: pointer; padding: 6px 0; }
.audit summary span { display: inline-block; min-width: 34px; font-weight: 800; }

/* Pages d'authentification et installateur */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 16px; background-color: #fff;
    background-image: linear-gradient(rgba(1, 120, 123, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(1, 120, 123, .08) 1px, transparent 1px); background-size: 24px 24px; }
.auth-card { width: 100%; max-width: 440px; background: #fff; border: 1.5px solid var(--ink); border-radius: 12px; padding: 32px; box-shadow: 0 20px 50px rgba(10, 61, 81, .12); }
.install-card { max-width: 720px; }
.install-card h2 { font-size: 1.1rem; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.auth-logo { width: 260px; height: auto; margin-bottom: 22px; }
.auth-card h1 { font-size: 1.45rem; }
.auth-card label { margin-bottom: 14px; }
.auth-links { margin-top: 18px; font-size: .9rem; text-align: center; color: var(--muted); }

/* Responsive */
@media (max-width: 1100px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-wide-left, .dash-grid { grid-template-columns: minmax(0, 1fr); }
    .start-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar-open .sidebar { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .admin-shell { margin-left: 0; }
    .sidebar-toggle { display: block; }
    .admin-main { padding: 18px 16px 50px; }
    .topbar { padding: 8px 14px; }
    .usermenu-name { display: none; }
    .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
    .mini-stats { grid-template-columns: 1fr 1fr; }
    .start-list { grid-template-columns: 1fr; }
    .row-actions { opacity: 1; }
}

/* RGPD et Analytics */
.start-list-1 { grid-template-columns: 1fr !important; }
.register-table td { font-size: .86rem; min-width: 140px; }
.hbars { list-style: none; padding: 0; margin: 0 0 12px; }
.hbars li { display: grid; grid-template-columns: 170px 1fr 48px; gap: 10px; align-items: center; padding: 4px 0; font-size: .9rem; }
.hbar { height: 10px; background: #E9EEF4; border-radius: 6px; overflow: hidden; }
.hbar span { display: block; height: 100%; background: var(--plan); border-radius: 6px; }
.hbar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }
@media print {
    .sidebar, .topbar, .tabs, .page-head, .box-head button, .toasts { display: none !important; }
    .admin-shell { margin: 0; }
    .admin-main { padding: 0; }
    .box { border: 0; padding: 0; }
    .register-table td, .register-table th { font-size: 9pt; }
}
.field-check.check-aligned { align-self: start; padding-top: 30px; }

/* ---- Avancement de la rédaction IA ---- */
.warn-text { color: #8A4B00; }
.queue-progress { margin: 0 0 22px; padding: 18px 20px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); }
.queue-progress.is-done { border-color: #B9DEC8; background: #F1F9F4; }
.qp-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; margin-bottom: 12px; }
.qp-title { margin: 0; font: 700 1.3rem/1.2 var(--display); letter-spacing: -.01em; }
.qp-meta { margin: 0; color: var(--muted); font-size: .92rem; }
.queue-progress .tape-progress { background: #fff; }
.qp-driver { margin: 12px 0 0; font-size: .92rem; color: var(--muted); }
.qp-driver.is-live { color: var(--ink); }
.qp-driver.is-live::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--metre); vertical-align: 1px; animation: live-pulse 1.6s ease-in-out infinite; }
.qp-current { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.qp-job { margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
.qp-step { margin: 0 0 12px; font-size: .95rem; }
.live-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--metre); box-shadow: 0 0 0 0 rgba(244, 156, 50, .45); animation: live-ring 1.8s ease-out infinite; }
@keyframes live-ring { 0% { box-shadow: 0 0 0 0 rgba(244, 156, 50, .45); } 70%, 100% { box-shadow: 0 0 0 9px rgba(244, 156, 50, 0); } }
@keyframes live-pulse { 50% { opacity: .35; } }

.step-track { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; padding: 0; counter-reset: none; }
.st { display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: .82rem; line-height: 1.3; color: var(--muted); }
.st-time { font-variant-numeric: tabular-nums; font-size: .76rem; color: var(--muted); }
.st-done { color: var(--ink); border-color: #B9DEC8; background: #F1F9F4; }
.st-done .st-name::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 5px; }
.st-running { color: #7A3600; border-color: var(--metre); background: #FFF1E5; font-weight: 700; }
.st-running .st-time { color: #7A3600; }
.st-running .st-name::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--metre); vertical-align: 1px; animation: live-pulse 1.2s ease-in-out infinite; }
.st-next { color: var(--ink); border-style: dashed; border-color: #9FB0C3; }
.st-todo { border-style: dashed; background: transparent; }
.st-failed { color: var(--red); border-color: #E7A99B; background: #FBEDE9; }

.queue-table .col-state { width: 250px; }
.queue-table tr.is-running td { background: #FFF8F1; }
.job-line { display: flex; align-items: center; gap: 8px; }
.job-pct { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.job-bar { display: block; height: 6px; margin: 6px 0 4px; border-radius: 3px; background: #E3E9F0; overflow: hidden; }
.job-bar > span { display: block; height: 100%; border-radius: 3px; background: var(--plan); transition: width .6s ease; }
.job-bar-running > span { background: var(--metre); }
.job-bar-done > span { background: var(--green); }
.job-bar-error > span { background: var(--red); }
.job-bar-waiting > span { background: transparent; }
.job-note { display: block; font-size: .82rem; color: var(--muted); }
.job-waiting { background: #E9EDF2; color: var(--muted); }
.job-running { background: #FFE7D1; color: #7A3600; }
.job-paused { background: #DDEAF8; color: var(--blue); }
.job-cancelled { background: #EEF1F4; color: var(--muted); }

.ai-pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; border: 1px solid #F3C49A; background: #FFF5E8; color: #7A3600; font-size: .85rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
.ai-pill:hover { border-color: var(--metre); }
.ai-pill-bar { width: 54px; height: 5px; border-radius: 3px; background: #F6D7BC; overflow: hidden; }
.ai-pill-bar > span { display: block; height: 100%; width: 0; background: var(--metre); transition: width .6s ease; }
.ai-pill.is-idle { background: #fff; border-color: var(--line); color: var(--muted); }
.ai-pill.is-idle .live-dot { background: #9FB0C3; animation: none; }
@media (max-width: 700px) { .ai-pill-text { display: none; } }
@media (prefers-reduced-motion: reduce) {
    .live-dot, .qp-driver.is-live::before, .st-running .st-name::before { animation: none; }
    .job-bar > span, .ai-pill-bar > span { transition: none; }
}
.grid-3 > .span-2 { grid-column: span 2; }
@media (max-width: 860px) { .grid-3 > .span-2 { grid-column: auto; } }
.model-status { display: block; margin-top: 4px; font-size: .85rem; }
.model-status:empty { display: none; }
.model-status.is-ok { color: var(--green); }
.model-status.is-warn { color: #8A4B00; }
.model-status.is-bad { color: var(--red); font-weight: 600; }
.model-status .btn-link { padding: 0; font-size: inherit; vertical-align: baseline; }

/* ---- Liste des articles : état et date modifiables ---- */
.pub-cell { padding-top: 10px; }
.pub-btn { display: inline-flex; align-items: center; gap: 6px; margin: -4px -8px; padding: 4px 8px; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; white-space: nowrap; }
.pub-btn:hover, .pub-btn[aria-expanded="true"] { border-color: var(--line); background: #fff; }
.pub-pen { color: var(--muted); opacity: 0; transition: opacity .12s; flex: none; }
tr:hover .pub-pen, .pub-btn:focus-visible .pub-pen, .pub-btn[aria-expanded="true"] .pub-pen { opacity: 1; }
@media (hover: none) { .pub-pen { opacity: .55; } }
tr.row-saved td { animation: row-saved 1.6s ease-out; }
@keyframes row-saved { 0% { background: #FFF1E5; } 100% { background: transparent; } }

.pub-pop { position: absolute; z-index: 150; width: 330px; padding: 16px 16px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 12px 32px rgba(10, 61, 81, .16); }
.pub-pop.is-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 14px 14px 0 0; padding-bottom: 22px; }
.pub-pop-title { margin: 0; font: 700 1rem/1.3 var(--display); }
.pub-pop-article { margin: 2px 0 12px; font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seg { display: flex; margin: 0 0 14px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: 6px 4px; border-radius: 6px; text-align: center; font-size: .86rem; font-weight: 600; color: var(--muted); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(10, 61, 81, .14); }
.seg input[value="published"]:checked + span { color: var(--green); }
.seg input[value="scheduled"]:checked + span { color: var(--blue); }
.seg input:focus-visible + span { outline: 3px solid var(--metre); outline-offset: 1px; }
.pub-pop-label { display: block; margin-bottom: 4px; font-size: .85rem; font-weight: 700; }
.pub-date-row { display: flex; gap: 8px; align-items: center; }
.pub-date-row input { flex: 1; min-width: 0; }
.pub-hint { min-height: 2.6em; margin: 8px 0 12px; font-size: .85rem; color: var(--muted); }
.pub-hint.is-error { color: var(--red); }
.pub-pop-actions { display: flex; gap: 8px; }
@media (prefers-reduced-motion: reduce) { tr.row-saved td { animation: none; } .pub-pen { transition: none; } }

/* ---- Maillage interne ---- */
.linking-form { display: grid; grid-template-columns: 1.3fr 1fr 1.2fr; gap: 6px 28px; align-items: start; }
.linking-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.linking-form .check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-bottom: 6px; }
.linking-form .check input { width: auto; margin: 0; }
.linking-form select { max-width: 120px; }
.linking-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 900px) { .linking-form { grid-template-columns: 1fr; } }
.linking-progress { margin-top: 22px; }
.linking-run-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.linking-run-actions:empty { display: none; }

.linking-results { list-style: none; margin: 18px 0 0; padding: 0; }
.linking-results:empty { display: none; }
.lr { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.lr:first-child { border-top: 0; }
.lr-title { margin: 0; font-weight: 700; }
.lr-title a { color: var(--ink); text-decoration: none; }
.lr-title a:hover { text-decoration: underline; }
.lr-state { margin: 0; font-size: .85rem; color: var(--muted); }
.lr-state.is-ok { color: var(--green); font-weight: 600; }
.lr-state.is-error { color: var(--red); }
.lr-links { grid-column: 1 / -1; list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lr-links li { font-size: .9rem; display: flex; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.lr-anchor { padding: 1px 7px; border-radius: 5px; background: #FFF1E5; color: #7A3600; font-weight: 600; }
.lr-arrow { color: var(--muted); }
.lr-actions { align-self: start; }
.lr.is-running .lr-title::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--metre); vertical-align: 2px; animation: live-pulse 1.4s ease-in-out infinite; }
.lr.is-undone .lr-title, .lr.is-undone .lr-links { opacity: .55; }
.lr.is-undone .lr-anchor { text-decoration: line-through; }

.linking-table td.num, .linking-table th.num { width: 190px; }
.in-zero { color: var(--red); font-weight: 700; }
.badge-orphan { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #FBEDE9; color: var(--red); font-size: .75rem; font-weight: 700; vertical-align: 1px; }
@media (prefers-reduced-motion: reduce) { .lr.is-running .lr-title::before { animation: none; } }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 20px; }
.check-grid .check { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 0; padding: 6px 0; }
.check-grid .check input { width: auto; margin: 0; }
.steps-list { margin: 0 0 18px; padding-left: 22px; }
.steps-list li { margin-bottom: 8px; }
.steps-list li::marker { font-weight: 700; color: var(--plan); }
.fb-box .notice { margin-bottom: 12px; }
.fb-gen { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.fb-gen .field { flex: 1; min-width: 150px; margin-bottom: 12px; }
.fb-gen .btn { margin-bottom: 12px; }
.fb-side textarea { font-size: .92rem; line-height: 1.5; }
.fb-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fb-status:empty { display: none; }
.fb-status { margin: 10px 0 0; }
