/*
 * Monsiteo : back-office admin.monsiteo.com
 * S'appuie sur les tokens de monsiteo.css (couleurs, polices, rayons). Interface dense mais aeree.
 */

:root {
  --sb-w: 256px;
  --top-h: 64px;
  --adm-bg: #FBF8F2;
  --adm-panel: #FFFFFF;
  --adm-line: #ECE7F3;
  --adm-hover: #F7F5FE;
  --ok: #0B6B4E;
  --warn: #8A5D00;
  --bad: #B32B1D;
}

body.adm { font-size: 15px; line-height: 1.55; background: var(--adm-bg); color: var(--ink); min-height: 100vh; }
.adm h1, .adm h2, .adm h3 { text-wrap: balance; }
.adm a { text-decoration: none; }
.adm a:hover { text-decoration: underline; }
.adm .btn:hover, .adm a.btn:hover, .adm .chip:hover, .adm .nav-link:hover, .adm .seg a:hover { text-decoration: none; }
.adm code, .adm .mono { font-family: var(--font-mono); font-size: .86em; }
.adm .muted { color: var(--ink-60); }
.adm .tiny { font-size: .78rem; }
.adm .nowrap { white-space: nowrap; }
.adm .right { text-align: right; }
.adm .num { font-variant-numeric: tabular-nums; }
.adm hr { border: 0; border-top: 1px solid var(--adm-line); margin: 1.2rem 0; }

/* ------------------------------------------------------------ Coquille */
.adm-shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--ink); color: #D9D5EA; display: flex; flex-direction: column; padding: 1.1rem .8rem 1rem; scrollbar-width: thin; scrollbar-color: #3a3558 transparent; z-index: 40; }
.brand { display: flex; align-items: center; gap: .65rem; padding: .35rem .6rem 1.2rem; color: #fff; }
.brand:hover { color: #fff; }
.brand-name { font: 750 1.32rem/1 var(--font-title); letter-spacing: -.02em; color: #fff; }
.brand-tag { font: 650 .66rem/1 var(--font-text); letter-spacing: .1em; text-transform: uppercase; color: var(--ink); background: var(--sun); padding: .35em .55em; border-radius: var(--r-full); }
.brand .logo-mark { transition: transform .45s var(--ease-bounce); }
.brand:hover .logo-mark { transform: rotate(-8deg) scale(1.06); }

.nav-group { margin: .9rem 0 .25rem; padding: 0 .7rem; font: 650 .68rem/1 var(--font-text); letter-spacing: .12em; text-transform: uppercase; color: #8E89AA; }
.nav-link { position: relative; display: flex; align-items: center; gap: .7rem; padding: .58rem .7rem; border-radius: 11px; color: #D9D5EA; font-weight: 520; font-size: .93rem; transition: background .18s, color .18s, transform .25s var(--ease-bounce); }
.nav-link svg { width: 19px; height: 19px; flex: none; opacity: .85; transition: transform .3s var(--ease-bounce); }
.nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav-link:hover svg { transform: translateY(-1px) rotate(-6deg); }
.nav-link.is-active { background: rgba(255, 255, 255, .1); color: #fff; font-weight: 620; }
.nav-link.is-active::before { content: ""; position: absolute; left: -.8rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--sun); }
.nav-link.is-active svg { opacity: 1; color: var(--sun); }
.nav-count { margin-left: auto; min-width: 1.5rem; padding: .18rem .45rem; border-radius: var(--r-full); background: var(--coral); color: #fff; font: 700 .7rem/1.1 var(--font-text); text-align: center; }
.nav-count.soft { background: rgba(255, 255, 255, .12); color: #E8E5F7; }
.sidebar-foot { margin-top: auto; padding: 1rem .6rem 0; border-top: 1px solid rgba(255, 255, 255, .08); font-size: .8rem; color: #8E89AA; }
.sidebar-foot a { color: #C9C4E0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; height: var(--top-h); display: flex; align-items: center; gap: .9rem; padding: 0 clamp(1rem, 2.4vw, 2rem); background: rgba(251, 248, 242, .86); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--adm-line); }
.burger { display: none; width: 42px; height: 42px; border-radius: 12px; border: 1.5px solid var(--adm-line); background: #fff; color: var(--ink); align-items: center; justify-content: center; cursor: pointer; }
.top-search { flex: 1; max-width: 520px; position: relative; }
.top-search input { width: 100%; height: 42px; border-radius: var(--r-full); border: 1.5px solid var(--adm-line); background: #fff; padding: 0 1rem 0 2.6rem; font: 400 .93rem var(--font-text); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.top-search input:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-100); }
.top-search svg { position: absolute; left: .95rem; top: 50%; width: 17px; height: 17px; transform: translateY(-50%); color: var(--ink-40); pointer-events: none; }
.top-search kbd { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); font: 600 .7rem var(--font-mono); color: var(--ink-60); border: 1px solid var(--adm-line); border-radius: 6px; padding: .15rem .4rem; background: var(--adm-bg); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
.top-link { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; font-weight: 560; color: var(--ink-80); padding: .5rem .75rem; border-radius: var(--r-full); }
.top-link:hover { background: #fff; color: var(--violet); text-decoration: none; }
.top-link svg { width: 16px; height: 16px; }

.usermenu { position: relative; }
.usermenu > summary { list-style: none; display: flex; align-items: center; gap: .55rem; cursor: pointer; padding: .3rem .4rem .3rem .3rem; border-radius: var(--r-full); border: 1.5px solid transparent; }
.usermenu > summary::-webkit-details-marker { display: none; }
.usermenu > summary:hover, .usermenu[open] > summary { background: #fff; border-color: var(--adm-line); }
.usermenu-panel { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 230px; background: #fff; border: 1.5px solid var(--adm-line); border-radius: 16px; box-shadow: var(--shadow-md); padding: .5rem; animation: pop .22s var(--ease-bounce); }
.usermenu-panel .who { padding: .5rem .65rem .7rem; border-bottom: 1px solid var(--adm-line); margin-bottom: .35rem; font-size: .85rem; }
.usermenu-panel button, .usermenu-panel a { display: flex; width: 100%; gap: .55rem; align-items: center; padding: .55rem .65rem; border-radius: 10px; border: 0; background: none; font: 520 .9rem var(--font-text); color: var(--ink); cursor: pointer; text-align: left; }
.usermenu-panel button:hover, .usermenu-panel a:hover { background: var(--adm-hover); text-decoration: none; }
.usermenu-panel svg { width: 17px; height: 17px; color: var(--ink-60); }

.avatar { --c: var(--violet); width: 34px; height: 34px; flex: none; border-radius: 50%; display: inline-grid; place-items: center; background: var(--c); color: #fff; font: 700 .8rem/1 var(--font-title); letter-spacing: 0; text-transform: uppercase; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.4rem; border-radius: 20px; }
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }

.content { padding: clamp(1.1rem, 2.6vw, 2.1rem) clamp(1rem, 2.6vw, 2.2rem) 3rem; width: 100%; max-width: 1480px; }
.backdrop { display: none; }

/* ------------------------------------------------------------ En-tete de page */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem 1.5rem; margin-bottom: 1.5rem; animation: rise .5s var(--ease-out) both; }
.page-head h1 { font-size: clamp(1.6rem, 2.6vw, 2.15rem); margin: 0; font-weight: 760; }
.page-head .sub { margin: .35rem 0 0; color: var(--ink-60); font-size: .95rem; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.crumbs { display: flex; flex-wrap: wrap; gap: .35rem; font-size: .82rem; color: var(--ink-60); margin-bottom: .45rem; }
.crumbs a { color: var(--ink-60); }
.crumbs a:hover { color: var(--violet); }
.crumbs span[aria-hidden] { color: var(--ink-40); }

/* ------------------------------------------------------------ Boutons compacts */
.adm .btn { font-size: .9rem; padding: .7em 1.15em; border-width: 1.5px; }
.adm .btn svg { width: 16px; height: 16px; }
.adm .btn:hover { transform: translateY(-2px); box-shadow: 3px 3px 0 var(--ink); }
.adm .btn:active { transform: translateY(0) scale(.98); box-shadow: none; }
.adm .btn-sm { font-size: .82rem; padding: .55em .9em; }
.adm .btn-xs { font-size: .76rem; padding: .42em .72em; gap: .35em; }
.adm .btn-xs svg { width: 14px; height: 14px; }
.btn-soft { --bg: #fff; --fg: var(--ink); border-color: var(--adm-line) !important; }
.btn-soft:hover { border-color: var(--ink) !important; }
.btn-danger { --bg: #fff; --fg: var(--bad); border-color: #F5C2BB !important; }
.btn-danger:hover { --bg: var(--coral-100); }
.btn-danger.solid { --bg: #C9372A; --fg: #fff; border-color: #C9372A !important; }
.btn-mint { --bg: var(--mint); --fg: var(--ink); }
.btn-block { width: 100%; }
.inline-form { display: inline; margin: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }

/* ------------------------------------------------------------ Panneaux et grilles */
.panel { background: var(--adm-panel); border: 1.5px solid var(--adm-line); border-radius: 18px; padding: clamp(1rem, 2vw, 1.4rem); min-width: 0; }
.panel + .panel { margin-top: 1.2rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: 1rem; }
.panel-head h2 { font-size: 1.06rem; margin: 0; letter-spacing: -.01em; font-weight: 700; }
.panel-head .muted { font-size: .85rem; }
.panel.flush { padding: 0; overflow: hidden; }
.panel.flush .panel-head { padding: 1rem 1.25rem 0; }
.panel.danger { border-color: #F5C2BB; background: #FFFBFA; }

.cols { display: grid; gap: 1.2rem; align-items: start; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols-main { grid-template-columns: minmax(0, 1fr) 360px; }
.cols-main-wide { grid-template-columns: minmax(0, 1fr) 320px; }
.stack-y > * + * { margin-top: var(--stack, 1.2rem); }
.stack-y > .panel + .panel { margin-top: var(--stack, 1.2rem); }
.section-gap { margin-top: 1.2rem; }

/* ------------------------------------------------------------ KPI */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; margin-bottom: 1.2rem; }
.kpi { position: relative; background: #fff; border: 1.5px solid var(--adm-line); border-radius: 18px; padding: 1rem 1.1rem 1.05rem; overflow: hidden; transition: transform .3s var(--ease-bounce), box-shadow .3s var(--ease-out), border-color .2s; animation: rise .55s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); color: var(--ink); }
a.kpi:hover { transform: translateY(-3px); box-shadow: 3px 3px 0 var(--ink); border-color: var(--ink); text-decoration: none; color: var(--ink); }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.kpi-label { font-size: .8rem; font-weight: 600; color: var(--ink-60); }
.kpi-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--violet-100); color: var(--violet); }
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-ico.sun { background: var(--sun-100); color: #8A5D00; }
.kpi-ico.mint { background: var(--mint-100); color: #0B6B4E; }
.kpi-ico.coral { background: var(--coral-100); color: #B32B1D; }
.kpi-ico.ink { background: #EDEBF4; color: var(--ink); }
.kpi-value { font: 760 1.85rem/1.1 var(--font-title); letter-spacing: -.02em; margin-top: .55rem; font-variant-numeric: tabular-nums; }
.kpi-sub { margin-top: .3rem; font-size: .8rem; color: var(--ink-60); display: flex; flex-wrap: wrap; gap: .25rem .6rem; }
.kpi-sub b { color: var(--ink); font-weight: 650; }
.kpi.accent { background: var(--ink); border-color: var(--ink); color: #fff; }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: #C9C4E0; }
.kpi.accent .kpi-sub b { color: #fff; }
.kpi.accent .kpi-ico { background: rgba(255, 255, 255, .12); color: var(--sun); }
a.kpi.accent:hover { color: #fff; box-shadow: 3px 3px 0 var(--sun); }

/* ------------------------------------------------------------ Badges d'etat */
.adm .badge { font-size: .72rem; padding: .36em .65em; gap: .4em; white-space: nowrap; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.gray { background: #EFEDF4; color: #4A4663; }
.badge.violet { background: var(--violet-100); color: var(--violet-700); }
.badge.outline { background: transparent; border: 1px solid var(--adm-line); color: var(--ink-60); }

/* ------------------------------------------------------------ Filtres */
.filters { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; margin-bottom: 1rem; }
.filters .grow { flex: 1 1 220px; min-width: 0; }
.ctl, .adm .field input, .adm .field select, .adm .field textarea { font: 400 .92rem/1.35 var(--font-text); color: var(--ink); background: #fff; border: 1.5px solid var(--adm-line); border-radius: 12px; padding: .6em .8em; transition: border-color .2s, box-shadow .2s; min-height: 40px; max-width: 100%; }
.ctl:focus, .adm .field input:focus, .adm .field select:focus, .adm .field textarea:focus { outline: none; border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-100); }
select.ctl, .adm .field select { padding-right: 2rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235B5775' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .7rem center; }
.ctl.search { padding-left: 2.3rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238E8AA6' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat .8rem center; width: 100%; }
.filters .reset { font-size: .85rem; color: var(--ink-60); }

.seg { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: 1rem; }
.seg a { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: var(--r-full); font-size: .86rem; font-weight: 560; color: var(--ink-80); border: 1.5px solid transparent; transition: background .18s, border-color .18s; }
.seg a:hover { background: #fff; border-color: var(--adm-line); }
.seg a.is-active { background: var(--ink); color: #fff; }
.seg a .n { font-size: .74rem; font-weight: 650; padding: .08rem .45rem; border-radius: var(--r-full); background: rgba(23, 20, 43, .07); }
.seg a.is-active .n { background: rgba(255, 255, 255, .16); }

/* ------------------------------------------------------------ Tableaux */
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: #fff; border: 1.5px solid var(--adm-line); border-radius: 18px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { padding: .72rem .9rem; text-align: left; border-bottom: 1px solid var(--adm-line); vertical-align: middle; }
.tbl thead th { position: sticky; top: 0; background: #FCFBFE; font: 650 .7rem/1.2 var(--font-text); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-60); white-space: nowrap; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover { background: var(--adm-hover); }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl td.right, .tbl th.right { text-align: right; }
.tbl .strong { font-weight: 620; color: var(--ink); }
.tbl .sub { display: block; font-size: .8rem; color: var(--ink-60); margin-top: .1rem; }
.tbl tr.is-muted td { opacity: .62; }
.tbl tfoot td { font-weight: 650; background: #FCFBFE; border-top: 1.5px solid var(--adm-line); }
.panel .tbl-wrap { border: 0; border-radius: 0; }
.panel.flush .tbl th:first-child, .panel.flush .tbl td:first-child { padding-left: 1.25rem; }
.cell-user { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.cell-user > div { min-width: 0; }
.cell-user .strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }
.row-link { color: var(--ink); font-weight: 620; }
.row-link:hover { color: var(--violet); }

.empty { text-align: center; padding: 2.6rem 1rem; color: var(--ink-60); }
.empty svg { width: 56px; height: 56px; margin: 0 auto .8rem; color: var(--violet); opacity: .9; }
.empty strong { display: block; color: var(--ink); font: 700 1.05rem var(--font-title); margin-bottom: .25rem; }

/* Pagination */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-top: 1rem; font-size: .86rem; color: var(--ink-60); }
.pager ul { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; margin: 0; padding: 0; }
.pager a, .pager span.pg { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 .6rem; border-radius: 10px; border: 1.5px solid var(--adm-line); background: #fff; color: var(--ink); font-weight: 560; }
.pager a:hover { border-color: var(--ink); text-decoration: none; }
.pager .is-current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pager .is-disabled { opacity: .45; }

/* ------------------------------------------------------------ Listes de details */
.dl { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: .55rem 1.1rem; margin: 0; font-size: .9rem; }
.dl dt { color: var(--ink-60); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.profile { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.profile h2 { margin: 0; font-size: 1.3rem; }

/* Fil d'activite */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .55rem 0; font-size: .88rem; }
.feed li::before { content: ""; position: absolute; left: 6px; top: 1.45rem; bottom: -.5rem; width: 2px; background: var(--adm-line); }
.feed li:last-child::before { display: none; }
.feed .pip { width: 14px; height: 14px; margin-top: .2rem; border-radius: 50%; background: var(--violet-100); border: 3px solid #fff; box-shadow: 0 0 0 1.5px var(--violet); }
.feed .pip.mint { box-shadow: 0 0 0 1.5px var(--mint); background: var(--mint-100); }
.feed .pip.coral { box-shadow: 0 0 0 1.5px var(--coral); background: var(--coral-100); }
.feed .pip.sun { box-shadow: 0 0 0 1.5px var(--sun); background: var(--sun-100); }
.feed time { color: var(--ink-60); font-size: .78rem; white-space: nowrap; }
.feed .what { min-width: 0; overflow-wrap: anywhere; }

/* ------------------------------------------------------------ Graphiques (HTML/CSS, sans librairie) */
.chart { --h: 190px; position: relative; padding-left: 2.8rem; }
.chart-plot { position: relative; height: var(--h); display: flex; align-items: flex-end; gap: 3px; border-bottom: 1.5px solid var(--ink-40); }
.chart-grid { position: absolute; inset: 0 0 0 0; pointer-events: none; }
.chart-grid span { position: absolute; left: 0; right: 0; border-top: 1px dashed #E3DEEE; }
.chart-grid em { position: absolute; right: calc(100% + .5rem); transform: translateY(-50%); font: 500 .7rem var(--font-text); color: var(--ink-60); font-style: normal; white-space: nowrap; }
.chart-col { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.chart-bar { width: min(100%, 34px); height: var(--v); min-height: 2px; background: var(--violet); border-radius: 4px 4px 0 0; transform-origin: bottom; animation: grow .7s var(--ease-out) both; animation-delay: calc(var(--i) * 22ms); transition: background .15s; }
.chart-bar.zero { background: #E3DEEE; }
.chart-col:hover .chart-bar, .chart-col:focus-visible .chart-bar { background: var(--violet-700); }
.chart-col:focus-visible { box-shadow: inset 0 0 0 2px var(--sun); border-radius: 6px; }
.chart-tip { position: absolute; bottom: calc(var(--v) + 10px); left: 50%; transform: translate(-50%, 4px); background: var(--ink); color: #fff; font: 500 .75rem/1.3 var(--font-text); padding: .4rem .6rem; border-radius: 8px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s; z-index: 5; }
.chart-tip b { display: block; font-weight: 700; font-size: .85rem; }
.chart-col.edge-l .chart-tip { left: 0; transform: translate(0, 4px); }
.chart-col.edge-r .chart-tip { left: auto; right: 0; transform: translate(0, 4px); }
.chart-col:hover .chart-tip, .chart-col:focus-visible .chart-tip { opacity: 1; transform: translate(-50%, 0); }
.chart-col.edge-l:hover .chart-tip, .chart-col.edge-l:focus-visible .chart-tip, .chart-col.edge-r:hover .chart-tip, .chart-col.edge-r:focus-visible .chart-tip { transform: translate(0, 0); }
.chart-x { display: flex; gap: 3px; margin-top: .45rem; }
.chart-x span { flex: 1 1 0; text-align: center; font-size: .7rem; color: var(--ink-60); white-space: nowrap; overflow: visible; }
.chart-x span.hide { visibility: hidden; }
/* Courbe : aire SVG + colonnes de survol (repere vertical et point) */
.chart-area { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.chart-area .fill { fill: var(--violet); opacity: .12; }
.chart-area .line { fill: none; stroke: var(--violet); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.chart.is-area .chart-plot { gap: 0; }
.chart.is-area .chart-col::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--ink-40); opacity: 0; transition: opacity .12s; }
.chart.is-area .chart-col::after { content: ""; position: absolute; left: 50%; bottom: var(--v); width: 10px; height: 10px; margin: 0 0 -5px -5px; border-radius: 50%; background: var(--violet); box-shadow: 0 0 0 2px #fff; opacity: 0; transition: opacity .12s; }
.chart.is-area .chart-col:hover::before, .chart.is-area .chart-col:hover::after, .chart.is-area .chart-col:focus-visible::before, .chart.is-area .chart-col:focus-visible::after { opacity: 1; }
.chart-total { font: 760 1.6rem/1 var(--font-title); letter-spacing: -.02em; }
.chart-data { margin-top: .8rem; font-size: .82rem; }
.chart-data summary { cursor: pointer; color: var(--ink-60); width: max-content; }
.chart-data .tbl { margin-top: .5rem; font-size: .82rem; }
.chart-data .tbl td, .chart-data .tbl th { padding: .35rem .6rem; }

/* Barres horizontales (tops, entonnoir) */
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.hbars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .8rem; font-size: .88rem; }
.hbars .track { grid-column: 1 / -1; height: 8px; border-radius: var(--r-full); background: #F0EDF6; overflow: hidden; }
.hbars .track i { display: block; height: 100%; width: var(--w); background: var(--violet); border-radius: var(--r-full); transform-origin: left; animation: growx .8s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
.hbars .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbars .val { font-weight: 650; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ Formulaires */
.adm .field { margin-bottom: 1rem; gap: .35rem; }
.adm .field label, .adm .label { font-weight: 600; font-size: .86rem; }
.adm .field .hint { font-size: .8rem; }
.adm .field textarea { min-height: 110px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid .full { grid-column: 1 / -1; }
.adm .checkbox { font-size: .9rem; margin-bottom: .7rem; }
.counter { font-size: .76rem; color: var(--ink-60); font-variant-numeric: tabular-nums; }
.counter.warn { color: var(--warn); font-weight: 600; }
.counter.over { color: var(--bad); font-weight: 650; }
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }
.is-invalid { border-color: #E36A5C !important; }
.radio-cards { display: grid; gap: .5rem; }
.radio-card { display: flex; gap: .7rem; align-items: flex-start; padding: .7rem .8rem; border: 1.5px solid var(--adm-line); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; font-size: .88rem; }
.radio-card:hover { border-color: var(--ink-40); }
.radio-card:has(input:checked) { border-color: var(--violet); background: var(--violet-50); }
.radio-card input { accent-color: var(--violet); margin-top: .2rem; }
.radio-card b { display: block; font-size: .9rem; }

/* ------------------------------------------------------------ Alertes flash (toasts) */
.toasts { position: fixed; right: 1rem; top: calc(var(--top-h) + .8rem); z-index: 60; display: grid; gap: .5rem; width: min(420px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .7rem; align-items: flex-start; padding: .85rem 1rem; border-radius: 14px; border: 1.5px solid; background: #fff; box-shadow: var(--shadow-md); font-size: .9rem; animation: toast-in .45s var(--ease-bounce) both; }
.toast svg { width: 19px; height: 19px; flex: none; margin-top: .1rem; }
.toast .x { margin-left: auto; border: 0; background: none; color: inherit; cursor: pointer; padding: .1rem; opacity: .6; border-radius: 6px; }
.toast .x:hover { opacity: 1; }
.toast.success { border-color: #8FE6C9; background: #F1FCF8; color: #0B5A42; }
.toast.error { border-color: #FFB4AA; background: #FFF6F4; color: #8E1E12; }
.toast.info { border-color: var(--violet-100); background: var(--violet-50); color: var(--violet-700); }
.toast.is-leaving { animation: toast-out .3s var(--ease-out) forwards; }
.form-errors { border-radius: 14px; padding: .9rem 1.1rem; margin-bottom: 1.2rem; background: #FFF6F4; border: 1.5px solid #FFB4AA; color: #8E1E12; font-size: .9rem; }
.form-errors ul { margin: .3rem 0 0; padding-left: 1.2rem; }

/* ------------------------------------------------------------ Fenetre de confirmation */
.adm-dialog { border: 0; padding: 0; border-radius: 22px; width: min(460px, calc(100vw - 2rem)); box-shadow: var(--shadow-lg); color: var(--ink); background: #fff; }
.adm-dialog::backdrop { background: rgba(23, 20, 43, .45); backdrop-filter: blur(2px); }
.adm-dialog[open] { animation: pop .3s var(--ease-bounce); }
.adm-dialog form { padding: 1.5rem; margin: 0; }
.adm-dialog h2 { font-size: 1.25rem; margin: 0 0 .5rem; }
.adm-dialog p { margin: 0 0 1rem; color: var(--ink-80); font-size: .93rem; }
.adm-dialog .dlg-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--violet-100); color: var(--violet); margin-bottom: .9rem; }
.adm-dialog.danger .dlg-ico { background: var(--coral-100); color: var(--bad); }
.adm-dialog .dlg-ico svg { width: 22px; height: 22px; }
.adm-dialog .dlg-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; flex-wrap: wrap; }
.adm-dialog input.ctl { width: 100%; }

/* ------------------------------------------------------------ Divers */
.meter { height: 6px; border-radius: var(--r-full); background: #F0EDF6; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--mint); width: var(--w); }
.copy-field { display: flex; gap: .4rem; }
.copy-field input { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: .8rem; }
.records { display: grid; gap: .6rem; }
.record { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: .25rem .8rem; padding: .75rem .9rem; border: 1.5px solid var(--adm-line); border-radius: 12px; font-size: .86rem; background: #FCFBFE; }
.record .type { font: 700 .8rem var(--font-mono); color: var(--violet-700); grid-row: span 2; align-self: center; }
.record code { overflow-wrap: anywhere; }
.preview-frame { position: relative; border: 1.5px solid var(--adm-line); border-radius: 16px; overflow: hidden; background: #fff; }
.preview-frame .bar { display: flex; align-items: center; gap: .4rem; padding: .55rem .8rem; border-bottom: 1px solid var(--adm-line); background: #FCFBFE; font-size: .78rem; color: var(--ink-60); }
.preview-frame .bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--coral); }
.preview-frame .bar i:nth-child(2) { background: var(--sun); }
.preview-frame .bar i:nth-child(3) { background: var(--mint); }
.preview-frame .bar span { margin-left: .4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-frame iframe { display: block; width: 100%; height: 520px; border: 0; background: #fff; }
.thumb { width: 64px; height: 42px; border-radius: 8px; object-fit: cover; background: var(--violet-50); border: 1px solid var(--adm-line); }
.note-box { white-space: pre-wrap; background: #FCFBFE; border: 1.5px solid var(--adm-line); border-radius: 12px; padding: .9rem 1rem; font-size: .92rem; }
.kv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.kv-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem 0; border-bottom: 1px dashed var(--adm-line); font-size: .9rem; }
.kv-list li:last-child { border-bottom: 0; }
.state { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .86rem; }
.state svg { width: 16px; height: 16px; }
.state.ok { color: var(--ok); }
.state.no { color: var(--bad); }
.state.warn { color: var(--warn); }

/* ------------------------------------------------------------ Editeur d'article */
.editor { border: 1.5px solid var(--adm-line); border-radius: 16px; background: #fff; overflow: hidden; }
.editor:focus-within { border-color: var(--violet); box-shadow: 0 0 0 4px var(--violet-100); }
.ed-toolbar { position: sticky; top: var(--top-h); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: .2rem; padding: .45rem; border-bottom: 1px solid var(--adm-line); background: #FCFBFE; }
.ed-toolbar button { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 .45rem; border: 0; border-radius: 9px; background: none; color: var(--ink-80); font: 650 .82rem var(--font-text); cursor: pointer; transition: background .15s, transform .2s var(--ease-bounce); }
.ed-toolbar button:hover { background: #fff; box-shadow: inset 0 0 0 1.5px var(--adm-line); transform: translateY(-1px); }
.ed-toolbar button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ed-toolbar svg { width: 17px; height: 17px; }
.ed-toolbar .sep { width: 1px; height: 22px; background: var(--adm-line); margin: 0 .25rem; }
.ed-toolbar .spacer { flex: 1; }
.ed-body { display: grid; grid-template-columns: minmax(0, 1fr); }
.ed-body textarea { display: block; width: 100%; min-height: 520px; border: 0; resize: vertical; padding: 1rem 1.1rem; font: 400 .9rem/1.65 var(--font-mono); color: var(--ink); background: #fff; tab-size: 2; }
.ed-body textarea:focus { outline: none; }
.ed-preview { display: none; padding: 1.2rem 1.5rem; border-left: 1px solid var(--adm-line); max-height: 760px; overflow: auto; background: var(--paper); }
.ed-preview.prose { font-size: 1rem; }
.editor[data-mode="split"] .ed-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.editor[data-mode="split"] .ed-preview, .editor[data-mode="preview"] .ed-preview { display: block; }
.editor[data-mode="preview"] textarea { display: none; }
.editor[data-mode="preview"] .ed-preview { border-left: 0; }
.ed-foot { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .9rem; border-top: 1px solid var(--adm-line); font-size: .76rem; color: var(--ink-60); background: #FCFBFE; }

.serp { border: 1.5px solid var(--adm-line); border-radius: 14px; padding: .9rem 1rem; background: #fff; font-family: Arial, Helvetica, sans-serif; }
.serp .s-url { display: flex; align-items: center; gap: .5rem; font-size: 12px; color: #202124; margin-bottom: .2rem; }
.serp .s-url i { width: 26px; height: 26px; border-radius: 50%; background: var(--violet-100); display: grid; place-items: center; }
.serp .s-url i svg { width: 18px; height: 18px; }
.serp .s-url small { display: block; color: #4D5156; font-size: 12px; }
.serp .s-title { color: #1A0DAB; font-size: 19px; line-height: 1.3; margin: .3rem 0 .15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.serp .s-desc { color: #4D5156; font-size: 13.5px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.faq-row { border: 1.5px solid var(--adm-line); border-radius: 12px; padding: .8rem .8rem .2rem; margin-bottom: .7rem; background: #FCFBFE; animation: rise .35s var(--ease-out) both; }
.faq-row .faq-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: .4rem; font-size: .8rem; font-weight: 650; color: var(--ink-60); }
.cover-box { display: grid; gap: .6rem; }
.cover-box img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; border: 1px solid var(--adm-line); background: var(--violet-50); }
.cover-drop { display: grid; place-items: center; text-align: center; gap: .3rem; padding: 1.2rem; border: 2px dashed var(--adm-line); border-radius: 12px; color: var(--ink-60); font-size: .85rem; cursor: pointer; transition: border-color .15s, background .15s; }
.cover-drop:hover, .cover-drop.is-over { border-color: var(--violet); background: var(--violet-50); }
.sticky-side { position: sticky; top: calc(var(--top-h) + 1rem); }

/* ------------------------------------------------------------ Connexion */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; background: var(--paper); position: relative; overflow: hidden; }
.login-page .blob { z-index: 0; }
.login-card { position: relative; z-index: 1; width: min(440px, 100%); background: #fff; border: 2px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); border-radius: 26px; padding: clamp(1.6rem, 5vw, 2.4rem); animation: pop .6s var(--ease-bounce) both; }
.login-card h1 { font-size: clamp(1.8rem, 6vw, 2.3rem); margin: 1.2rem 0 .3rem; }
.login-card .lead { font-size: 1rem; margin-bottom: 1.5rem; }
.login-card .field input { min-height: 46px; }
.login-card .btn { width: 100%; margin-top: .4rem; font-size: 1rem; padding: .95em 1.2em; }
.login-foot { margin-top: 1.4rem; font-size: .82rem; color: var(--ink-60); text-align: center; }

/* ------------------------------------------------------------ Animations */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes growx { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes toast-in { from { opacity: 0; transform: translateX(30px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(30px); } }

/* ------------------------------------------------------------ Responsive */
@media (max-width: 1280px) {
  .cols-main { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-main, .cols-main-wide { grid-template-columns: minmax(0, 1fr); }
  .sticky-side { position: static; }
}
@media (max-width: 1024px) {
  .adm-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(var(--sb-w), 86vw); transform: translateX(-102%); transition: transform .35s var(--ease-out); box-shadow: var(--shadow-lg); }
  .nav-open .sidebar { transform: none; }
  .backdrop { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(23, 20, 43, .4); opacity: 0; pointer-events: none; transition: opacity .3s; }
  .nav-open .backdrop { opacity: 1; pointer-events: auto; }
  .burger { display: inline-flex; }
  .top-search kbd { display: none; }
}
@media (max-width: 760px) {
  body.adm { font-size: 14.5px; }
  .cols-2, .cols-3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .kpi { padding: .85rem .9rem; }
  .kpi-value { font-size: 1.45rem; }
  .kpi-ico { display: none; }
  .top-link .lbl, .usermenu .uname { display: none; }
  .topbar { gap: .5rem; }
  .content { padding-bottom: 4rem; }
  .page-head { align-items: flex-start; }
  .page-head .actions { width: 100%; }
  .chart { --h: 150px; padding-left: 2.3rem; }
  .ed-body textarea { min-height: 380px; }
  .editor[data-mode="split"] .ed-body { grid-template-columns: minmax(0, 1fr); }
  .editor[data-mode="split"] .ed-preview { border-left: 0; border-top: 1px solid var(--adm-line); }
  .preview-frame iframe { height: 420px; }
  .dl { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .dl dd { margin-bottom: .55rem; }
  .filters > * { flex: 1 1 auto; }
  .filters .grow { flex-basis: 100%; }

  /* Tableaux en cartes sur petit ecran */
  .tbl.stack thead { display: none; }
  .tbl.stack, .tbl.stack tbody, .tbl.stack tr, .tbl.stack td { display: block; width: 100%; }
  .tbl.stack tr { padding: .75rem .9rem; border-bottom: 1px solid var(--adm-line); }
  .tbl.stack tbody tr:last-child { border-bottom: 0; }
  .tbl.stack td { border: 0; padding: .2rem 0; display: flex; justify-content: space-between; gap: 1rem; text-align: right; }
  .tbl.stack td::before { content: attr(data-label); flex: none; font-size: .74rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-60); text-align: left; padding-top: .15rem; }
  .tbl.stack td.primary { display: block; text-align: left; padding-bottom: .35rem; }
  .tbl.stack td.primary::before { display: none; }
  .tbl.stack td:empty { display: none; }
  .tbl.stack td.actions-cell { justify-content: flex-start; padding-top: .5rem; }
  .tbl.stack td.actions-cell::before { display: none; }
  .panel.flush .tbl.stack td:first-child { padding-left: 0; }
  .cell-user .strong { max-width: 220px; }
}
@media (max-width: 420px) {
  .kpis { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kpi-value { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) {
  .chart-bar, .hbars .track i, .kpi, .page-head, .faq-row, .login-card, .toast { animation: none !important; }
}
@media print {
  .sidebar, .topbar, .toasts, .page-head .actions, .filters, .pager { display: none !important; }
  .adm-shell { display: block; }
}

/* Etiquettes de l'axe X : une sur deux sur petit ecran */
@media (max-width: 760px) {
  .chart-x span:nth-child(2n) { visibility: hidden; }
  .chart-x span { font-size: .64rem; }
}
.cell-user .tiny { display: block; }
.radio-card .tiny { display: block; font-weight: 400; }

/* Garde-fous de debordement horizontal */
.chart { min-width: 0; overflow: visible; }
.chart-col, .chart-x span { min-width: 0; }
.chart-x { overflow: hidden; }
.kv-list li > * { min-width: 0; overflow-wrap: anywhere; }
.kv-list code { overflow-wrap: anywhere; }
.cols > * { min-width: 0; }
.cols > .panel + .panel, .cols > .panel { margin-top: 0; }
.kpi-sub { display: block; }
.kpi-sub > span + span { margin-left: .6rem; }
.adm [hidden] { display: none !important; }
.adm .editor .ed-body textarea { min-height: 520px; border: 0; border-radius: 0; box-shadow: none; padding: 1rem 1.1rem; font: 400 .9rem/1.65 var(--font-mono); }
.adm .editor .ed-body textarea:focus { box-shadow: none; }
@media (max-width: 760px) { .adm .editor .ed-body textarea { min-height: 380px; } .ed-toolbar { position: static; } }
