* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--grad-page); background-attachment: fixed; color: var(--text); font: 400 var(--fs-md)/1.5 var(--f-body); min-height: 100vh; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
h2 { font-size: var(--fs-lg); font-weight: 600; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-muted); }
.grad-text { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--grad-sidebar); border-right: 1px solid var(--border); padding: var(--sp-5) var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-4); position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: var(--sp-3); text-decoration: none; padding: 0 var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); }
.brand-mark { width: 40px; height: 40px; }
.brand-name { font: 700 19px/1.05 var(--f-display); }
.brand-name span { display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-3); border-radius: var(--radius-sm); text-decoration: none; color: var(--text-muted); font-weight: 500; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.nav a:hover { background: var(--surface-hover); color: var(--text); }
.nav a[aria-current="page"] { background: linear-gradient(90deg, rgba(149, 98, 223, .45), rgba(212, 60, 232, .18)); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong), var(--glow); }
.nav .sep { height: 1px; background: var(--border); margin: var(--sp-2) var(--sp-2); }
.nav a.disabled { opacity: .55; pointer-events: none; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: var(--sp-4); padding: var(--sp-4) var(--sp-5); position: sticky; top: 0; z-index: 5; background: rgba(9, 13, 53, .78); backdrop-filter: var(--blur); border-bottom: 1px solid var(--border); }
.space-label { font-size: var(--fs-xs); color: var(--text-faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.search { flex: 1; max-width: 440px; margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-faint); }
.search input { border: 0; background: none; outline: none; width: 100%; color: var(--text); }
.search input::placeholder { color: var(--text-faint); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.icon-btn:disabled { cursor: not-allowed; opacity: .6; }
.menu-btn { display: none; }
.scrim { display: none; }
#view { padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-5); outline: none; }

/* ---------- Composants ---------- */
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border); }
.seg button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 14px; border-radius: var(--radius-pill); cursor: pointer; color: var(--text-muted); font-weight: 600; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
.seg button:hover { color: var(--text); }
.seg button[aria-checked="true"] { background: var(--grad-brand); color: #fff; box-shadow: var(--glow); }
.seg.sm button { padding: 6px 12px; font-size: var(--fs-sm); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); backdrop-filter: var(--blur); padding: var(--sp-5); min-width: 0; position: relative; }
.card-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.card-head .i { color: var(--c-violet); }
.card-head .actions { margin-left: auto; display: flex; gap: var(--sp-2); align-items: center; }

.btn { display: inline-flex; align-items: center; gap: var(--sp-2); padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-weight: 600; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease); text-decoration: none; }
.btn:hover:not(:disabled) { background: var(--surface-hover); }
.btn-primary { background: var(--grad-brand); border-color: transparent; color: #fff; box-shadow: var(--glow); }
.btn-primary:hover:not(:disabled) { background: var(--grad-brand); transform: translateY(-1px); box-shadow: 0 0 30px rgba(212, 60, 232, .4); }
.btn:disabled { cursor: not-allowed; opacity: .5; }
.btn-ghost { background: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: rgba(91, 227, 168, .35); background: rgba(91, 227, 168, .1); }
.badge.warn { color: var(--warn); border-color: rgba(255, 194, 102, .35); background: rgba(255, 194, 102, .1); }
.badge.bad { color: var(--danger); border-color: rgba(255, 122, 150, .35); background: rgba(255, 122, 150, .1); }

.pf { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; font: 700 11px/1 var(--f-display); color: #0B0E33; background: var(--pf, var(--c-violet)); flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; }
.input, .textarea, .select { width: 100%; background: rgba(9, 13, 53, .55); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; color: var(--text); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--border-strong); box-shadow: var(--glow); }
.textarea { min-height: 120px; resize: vertical; }
.select option { background: var(--surface-solid); }

.empty { display: grid; place-items: center; text-align: center; gap: var(--sp-2); padding: var(--sp-5); color: var(--text-muted); border: 1px dashed var(--border); border-radius: var(--radius); min-height: 140px; }
.empty .i { width: 28px; height: 28px; color: var(--c-violet); }
.empty strong { color: var(--text); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--surface-solid); border: 1px solid var(--border-strong); padding: 10px 18px; border-radius: var(--radius-pill); box-shadow: var(--shadow-card); z-index: 50; }

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 10px; border-bottom: 1px solid rgba(149, 98, 223, .14); vertical-align: middle; }
.table-wrap { overflow-x: auto; }

/* ---------- Bandeau ---------- */
.hero { position: relative; overflow: hidden; border-radius: var(--radius-lg); border: 1px solid var(--border); min-height: 210px; display: flex; align-items: center; padding: var(--sp-6); background:
  linear-gradient(90deg, rgba(9, 13, 53, .96) 0%, rgba(9, 13, 53, .7) 42%, rgba(9, 13, 53, 0) 70%),
  linear-gradient(180deg, #120F45 0%, #3A1870 55%, #7A2486 80%, #2A0F55 100%); }
.hero-text { position: relative; z-index: 2; max-width: 560px; border-left: 2px solid var(--c-violet); padding-left: var(--sp-5); }
.hero-kicker { margin: 0; font: 400 var(--fs-2xl)/1.1 var(--f-display); }
.hero h1 { font-size: var(--fs-3xl); line-height: 1.1; }
.hero p.lead { color: var(--text-muted); margin: var(--sp-3) 0 0; }
.hero-art { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-art .sun { position: absolute; right: 14%; bottom: 34%; width: 180px; height: 180px; border-radius: 50%; background: linear-gradient(180deg, #FF7AD9 0%, #D43CE8 55%, #9562DF 100%); box-shadow: 0 0 80px rgba(212, 60, 232, .55); -webkit-mask: repeating-linear-gradient(180deg, #000 0 14px, transparent 14px 18px); mask: linear-gradient(#000 55%, transparent 55%) top/100% 100% no-repeat, repeating-linear-gradient(180deg, #000 0 12px, transparent 12px 17px); }
.hero-art .hills { position: absolute; left: 30%; right: 0; bottom: 30%; height: 70px; background: #1B0F48; clip-path: polygon(0 100%, 8% 55%, 18% 70%, 30% 30%, 42% 62%, 55% 40%, 66% 66%, 78% 35%, 90% 60%, 100% 45%, 100% 100%); opacity: .95; }
.hero-art .city { position: absolute; right: 3%; bottom: 29%; width: min(560px, 44%); height: auto; filter: drop-shadow(0 0 10px rgba(212, 60, 232, .35)); }
.hero-art .halo { position: absolute; right: 18%; bottom: 25%; width: 360px; height: 220px; background: radial-gradient(closest-side, rgba(255, 122, 217, .45), rgba(212, 60, 232, .15) 60%, transparent); }
.hero-art .grid { position: absolute; left: 30%; right: 0; bottom: 0; height: 30%; background:
  linear-gradient(180deg, rgba(212, 60, 232, .35), transparent 80%),
  repeating-linear-gradient(90deg, rgba(212, 60, 232, .55) 0 1px, transparent 1px 48px),
  repeating-linear-gradient(180deg, rgba(212, 60, 232, .45) 0 1px, transparent 1px 16px), #12093A; transform: perspective(240px) rotateX(48deg); transform-origin: bottom; }
.hero-note { position: absolute; right: 12px; bottom: 10px; z-index: 2; font-size: 11px; color: var(--text-faint); background: rgba(9, 13, 53, .6); padding: 2px 8px; border-radius: var(--radius-pill); }

/* ---------- Dashboard ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); }
.kpi { display: flex; gap: var(--sp-4); align-items: center; padding: var(--sp-4) var(--sp-5); overflow: hidden; }
.kpi::after { content: ""; position: absolute; right: -30px; bottom: -40px; width: 160px; height: 80px; background: radial-gradient(closest-side, rgba(212, 60, 232, .35), transparent); pointer-events: none; }
.kpi-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--radius); background: linear-gradient(135deg, rgba(149, 98, 223, .45), rgba(53, 32, 107, .8)); border: 1px solid var(--border); flex: none; }
.kpi-ico .i { width: 26px; height: 26px; }
.kpi-label { color: var(--text-muted); font-size: var(--fs-sm); font-weight: 500; }
.kpi-value { font: 700 var(--fs-2xl)/1.15 var(--f-display); display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.kpi-value.sm { font-size: var(--fs-lg); }
.kpi-pfs { display: flex; gap: 4px; flex-wrap: wrap; }
.kpi-pfs .pf { width: 22px; height: 22px; font-size: 10px; border-radius: 6px; }

.row { display: grid; gap: var(--sp-5); }
.row-a { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
.row-b { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }

.composer .seg { width: 100%; justify-content: space-between; margin-bottom: var(--sp-4); }
.composer .seg button { flex: 1; justify-content: center; }
.composer .counter { position: absolute; right: 14px; bottom: 10px; font-size: var(--fs-xs); color: var(--text-faint); }
.composer .ta-wrap { position: relative; }
.composer-foot { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-top: var(--sp-4); }
.composer-foot .spacer { flex: 1; }
.soon { font-size: var(--fs-xs); color: var(--text-faint); }

.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--sp-5); }
.cal-nav { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin-bottom: var(--sp-3); font-weight: 600; text-transform: capitalize; }
.cal-nav button { border: 0; background: none; cursor: pointer; padding: 4px; color: var(--text-muted); border-radius: 6px; }
.cal-nav button:hover { color: var(--text); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal .dow { font-size: var(--fs-xs); color: var(--text-faint); padding-bottom: 6px; }
.cal button { position: relative; border: 0; background: none; padding: 7px 0 11px; border-radius: 10px; cursor: pointer; font-size: var(--fs-sm); }
.cal button:hover { background: var(--surface-hover); }
.cal button.out { color: var(--text-faint); opacity: .55; }
.cal button.today { box-shadow: inset 0 0 0 1px var(--border-strong); }
.cal button[aria-pressed="true"] { background: var(--grad-brand); color: #fff; box-shadow: var(--glow); }
.cal button .dot { position: absolute; left: 50%; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; transform: translateX(-50%); background: var(--c-magenta); }
.cal button[aria-pressed="true"] .dot { background: #fff; }
.day-panel { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--sp-4); min-width: 0; }
.day-panel h3 { font-size: var(--fs-md); display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-3); }
.up-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.up-list li { display: flex; gap: var(--sp-3); align-items: center; padding: 10px; border-radius: var(--radius-sm); background: rgba(9, 13, 53, .5); border: 1px solid var(--border); }
.up-list .t { font-weight: 700; font-size: var(--fs-sm); }
.up-list .s { font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-panel .empty { min-height: 160px; }

.stats-empty { min-height: 220px; }
.ghost-chart { width: 100%; height: 90px; opacity: .35; }

/* ---------- Pages ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); }
.page-head h1 { font-size: var(--fs-2xl); }
.page-head .actions { margin-left: auto; display: flex; gap: var(--sp-2); }
.drafts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-4); }
.draft h3 { font-size: var(--fs-md); margin-bottom: 6px; }
.draft p { margin: 0 0 var(--sp-3); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.draft .meta { display: flex; gap: var(--sp-2); align-items: center; font-size: var(--fs-xs); color: var(--text-faint); }
.draft .meta .btn { margin-left: auto; padding: 5px 10px; font-size: var(--fs-xs); }

/* ---------- Composeur ---------- */
.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.field > span:first-child { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 600; }
.hint { font-size: var(--fs-xs); color: var(--text-faint); }
.inline { display: inline-flex; gap: var(--sp-2); align-items: center; }
.compose-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.notice { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-4); border-color: rgba(255, 194, 102, .4); }
.dest-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.dest { border: 1px solid var(--border); border-radius: var(--radius); background: rgba(9, 13, 53, .45); transition: border-color var(--dur) var(--ease); }
.dest.on { border-color: var(--border-strong); box-shadow: var(--glow); }
.dest-head { display: flex; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); cursor: pointer; }
.dest-head input { width: 18px; height: 18px; accent-color: var(--c-magenta); }
.dest-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dest-count { margin-left: auto; font-size: var(--fs-xs); color: var(--text-faint); font-variant-numeric: tabular-nums; }
.dest-count.over { color: var(--danger); font-weight: 700; }
.dest-body { padding: 0 var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.dest-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3); }
.dest details summary { cursor: pointer; font-size: var(--fs-sm); color: var(--text-muted); }
.dest details[open] summary { margin-bottom: var(--sp-2); }
.preview { background: var(--surface-solid); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: var(--sp-3); }
.pv-head { display: flex; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.pv-text { white-space: pre-wrap; word-break: break-word; font-size: var(--fs-sm); }
.pv-media { margin-top: var(--sp-2); font-size: var(--fs-xs); color: var(--text-faint); }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.checks li::before { content: "● "; }
.checks .bad { color: var(--danger); } .checks .warn { color: var(--warn); } .checks .ok { color: var(--ok); }
.err-line { margin: 0; color: var(--danger); font-size: var(--fs-sm); }
.action-bar { position: sticky; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-3) var(--sp-4); background: rgba(9, 13, 53, .9); backdrop-filter: var(--blur); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.action-bar .spacer { flex: 1; }
.dlg { width: min(640px, calc(100vw - 32px)); background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); padding: var(--sp-5); box-shadow: var(--shadow-card), var(--glow); }
.dlg::backdrop { background: rgba(3, 5, 28, .7); backdrop-filter: blur(3px); }
.dlg-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.info-box, .warn-box { margin: 0; padding: var(--sp-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.info-box { background: rgba(125, 187, 255, .1); border: 1px solid rgba(125, 187, 255, .35); }
.warn-box { background: rgba(255, 122, 150, .1); border: 1px solid rgba(255, 122, 150, .4); color: var(--danger); font-weight: 600; }
.pre { max-height: 240px; overflow: auto; font-size: 12px; background: var(--c-night); padding: var(--sp-3); border-radius: var(--radius-sm); }

/* ---------- Tableau éditable ---------- */
.save-state { font-size: var(--fs-sm); color: var(--text-faint); }
.save-state.ok { color: var(--ok); } .save-state.bad { color: var(--danger); }
.tb-tools { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); z-index: 3; }
.tb-search { margin: 0; max-width: 320px; }
.tb-sel { width: auto; padding: 8px 12px; }
.tb-tools .hint { flex-basis: 100%; }
.cols-menu { position: relative; }
.cols-menu summary { list-style: none; }
.cols-menu summary::-webkit-details-marker { display: none; }
.cols-menu .menu { position: absolute; z-index: 10; top: calc(100% + 6px); left: 0; display: flex; flex-direction: column; gap: 6px; padding: var(--sp-3); min-width: 220px; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.bulk { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; padding: var(--sp-3) var(--sp-4); border-color: var(--border-strong); }
.bulk[hidden] { display: none; }
.bulk .spacer { flex: 1; }
.grid-wrap { position: relative; overflow: auto; max-height: calc(100vh - 290px); min-height: 220px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); outline: none; }
.grid-wrap:focus-visible { box-shadow: 0 0 0 2px var(--focus); }
.grid { border-collapse: separate; border-spacing: 0; font-size: var(--fs-sm); min-width: 100%; user-select: none; }
.grid th { position: sticky; top: 0; z-index: 2; background: var(--surface-solid); border-bottom: 1px solid var(--border-strong); padding: 0; text-align: left; white-space: nowrap; }
.grid th button { all: unset; display: block; padding: 10px; cursor: pointer; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 700; }
.grid th button:hover { color: var(--text); }
.grid th button:focus-visible { outline: 2px solid var(--focus); }
.grid td { padding: 8px 10px; border-bottom: 1px solid rgba(149, 98, 223, .14); border-right: 1px solid rgba(149, 98, 223, .08); vertical-align: top; max-width: 340px; }
.grid td.ed { cursor: cell; }
.grid td.k-body, .grid td.k-notes { white-space: pre-wrap; word-break: break-word; display: table-cell; }
.grid td.k-body { max-height: 6em; }
.grid tr:hover td { background: rgba(149, 98, 223, .06); }
.grid tr.picked td { background: rgba(212, 60, 232, .08); }
.grid tr.locked td.ed { color: var(--text-muted); cursor: not-allowed; }
.grid td.in-range { background: rgba(149, 98, 223, .22) !important; }
.grid td.active { box-shadow: inset 0 0 0 2px var(--c-magenta); background: rgba(212, 60, 232, .12) !important; }
.grid td.sel, .grid th.sel { width: 36px; text-align: center; padding: 8px 6px; }
.grid th.sel { padding: 10px 6px; }
.grid td.sel input, .grid th.sel input { width: 16px; height: 16px; accent-color: var(--c-magenta); }
.grid td.act, .grid th.act { width: 36px; padding: 6px 4px; }
.mini { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--text-muted); }
.mini:hover { background: var(--surface-hover); color: var(--text); }
.mini .i { width: 16px; height: 16px; }
.faint { color: var(--text-faint); }
.thumbs { display: inline-flex; gap: 4px; align-items: center; }
.thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); display: inline-grid; place-items: center; background: var(--surface-2); }
.thumb .i { width: 16px; height: 16px; }
.more { font-size: var(--fs-xs); color: var(--text-faint); }
.dl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dl li { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.dl .pf { width: 20px; height: 20px; font-size: 9px; border-radius: 5px; }
.dl .dn { overflow: hidden; text-overflow: ellipsis; max-width: 110px; color: var(--text-muted); }
.dl b { font-weight: 600; font-variant-numeric: tabular-nums; }
.dl i { font-style: normal; font-size: 10px; padding: 0 4px; border-radius: 4px; background: var(--c-violet-deep); }
.grid .bad { color: var(--danger); }
.cell-editor { position: absolute; z-index: 5; margin: 0; padding: 8px 10px; background: var(--c-night); color: var(--text); border: 2px solid var(--c-magenta); border-radius: 4px; box-shadow: var(--glow); font: inherit; font-size: var(--fs-sm); resize: both; outline: none; }
.dlg-wide { width: min(860px, calc(100vw - 32px)); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-3); margin-top: var(--sp-3); }

/* ---------- Créneaux ---------- */
.week { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 860px; font-size: var(--fs-sm); }
.week th { text-align: left; font-size: var(--fs-xs); color: var(--text-muted); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--border-strong); text-transform: capitalize; white-space: nowrap; }
.week th.today { color: var(--c-magenta); }
.week tbody th { text-transform: none; font-size: var(--fs-sm); color: var(--text); border-bottom: 1px solid var(--border); max-width: 180px; }
.week .dn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; display: inline-block; vertical-align: middle; }
.week td { vertical-align: top; padding: 6px; border-bottom: 1px solid var(--border); border-left: 1px solid rgba(149, 98, 223, .1); min-width: 110px; }
.week td.paused { background: repeating-linear-gradient(135deg, transparent 0 8px, rgba(255, 194, 102, .06) 8px 16px); }
.slot { display: block; margin: 2px 0; padding: 3px 8px; border-radius: 6px; font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend .slot { display: inline-block; margin: 0 4px 0 12px; }
.legend { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--sp-3); }
.slot.free { border: 1px dashed var(--c-violet); color: var(--text-muted); }
.slot.busy { background: var(--grad-brand); color: #fff; }
.slot.off { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.slot.conflict { background: rgba(255, 122, 150, .22); border: 1px solid var(--danger); color: var(--danger); }
.slot.past { opacity: .45; }
.notice-bad { display: flex; gap: var(--sp-3); align-items: flex-start; border-color: rgba(255, 122, 150, .5); }
.days { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.day input { position: absolute; opacity: 0; pointer-events: none; }
.day span { display: inline-block; padding: 6px 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); cursor: pointer; font-weight: 600; font-size: var(--fs-sm); color: var(--text-muted); }
.day input:checked + span { background: var(--grad-brand); color: #fff; border-color: transparent; }
.day input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.pause-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-sm); }
.pause-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: 6px 10px; border-radius: var(--radius-sm); background: var(--surface-2); }
.pause-list .btn { padding: 4px 8px; }
.table.rules tr.off td { color: var(--text-faint); }
.prio { margin: 0 0 var(--sp-3); padding-left: 22px; display: flex; flex-direction: column; gap: 4px; }
.dest-when { display: flex; gap: 6px; align-items: flex-end; }
.dest-when .input { flex: 1; }
.src-tag { font-size: 11px; color: var(--text-faint); }

/* ---------- Calendrier éditorial ---------- */
.cal-title { font-family: var(--f-display); font-size: var(--fs-lg); display: inline-block; }
.cal-title::first-letter { text-transform: uppercase; }
.tb-tools .spacer { flex: 1; }
.cal-card { padding: var(--sp-3); overflow-x: auto; }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); gap: 4px; min-width: 860px; }
.mdow { font-size: var(--fs-xs); color: var(--text-faint); font-weight: 700; text-transform: uppercase; padding: 4px 6px; }
.mday { min-height: 118px; padding: 4px; border-radius: var(--radius-sm); background: rgba(9, 13, 53, .45); border: 1px solid rgba(149, 98, 223, .14); display: flex; flex-direction: column; gap: 3px; }
.mday.out { opacity: .5; }
.mday.today { border-color: var(--border-strong); box-shadow: var(--glow); }
.mday-head { display: flex; justify-content: space-between; align-items: center; }
.dnum { all: unset; cursor: pointer; font-weight: 700; font-size: var(--fs-sm); padding: 2px 6px; border-radius: 6px; }
.dnum:hover, .dnum:focus-visible { background: var(--surface-hover); outline: 2px solid transparent; }
.dnum:focus-visible { outline-color: var(--focus); }
.add { all: unset; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--text-faint); opacity: 0; }
.mday:hover .add, .thead:hover .add, .add:focus-visible { opacity: 1; }
.add:hover { background: var(--surface-hover); color: var(--text); }
.add:focus-visible { outline: 2px solid var(--focus); }
.add .i { width: 14px; height: 14px; }
.ev { all: unset; box-sizing: border-box; cursor: grab; display: flex; align-items: center; gap: 5px; width: 100%; padding: 3px 6px; border-radius: 6px; font-size: 12px; background: var(--surface-2); border-left: 3px solid var(--pf, var(--c-violet)); overflow: hidden; white-space: nowrap; }
.ev:focus-visible { outline: 2px solid var(--focus); }
.ev .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.ev .n { overflow: hidden; text-overflow: ellipsis; }
.ev .pfdot { width: 6px; height: 6px; border-radius: 50%; background: var(--pf); flex: none; }
.ev.st-brouillon { background: transparent; border: 1px dashed var(--border); border-left: 3px solid var(--pf); color: var(--text-muted); }
.ev.st-a_valider { box-shadow: inset 0 0 0 1px rgba(255, 194, 102, .5); }
.ev.st-programmee { background: linear-gradient(90deg, rgba(149, 98, 223, .5), rgba(212, 60, 232, .3)); }
.ev.st-publiee { background: rgba(91, 227, 168, .14); }
.ev.st-erreur, .ev.conflict { background: rgba(255, 122, 150, .18); box-shadow: inset 0 0 0 1px var(--danger); }
.ev[draggable="false"] { cursor: pointer; }
.ev.sib { outline: 2px solid var(--c-magenta); outline-offset: 1px; }
.ev.dragging { opacity: .4; }
.more-ev { all: unset; cursor: pointer; font-size: 11px; color: var(--text-muted); padding: 0 6px; }
.more-ev:hover { color: var(--text); }
.drop-on { background: rgba(212, 60, 232, .16) !important; box-shadow: inset 0 0 0 2px var(--c-magenta); }
.pending { opacity: .6; }
.tgrid { display: grid; grid-template-columns: 56px repeat(var(--cols), minmax(120px, 1fr)); min-width: calc(56px + var(--cols) * 120px); }
.tcorner, .thead { position: sticky; top: 0; z-index: 1; background: var(--surface-solid); }
.thead { display: flex; justify-content: space-between; align-items: center; padding: 6px; border-bottom: 1px solid var(--border-strong); text-transform: capitalize; }
.thead.today .dnum { color: var(--c-magenta); }
.thour { font-size: 11px; color: var(--text-faint); padding: 4px 6px; border-top: 1px solid rgba(149, 98, 223, .12); text-align: right; }
.tcell { min-height: 40px; padding: 3px; border-top: 1px solid rgba(149, 98, 223, .12); border-left: 1px solid rgba(149, 98, 223, .08); display: flex; flex-direction: column; gap: 3px; }
.free-slot { all: unset; cursor: pointer; font-size: 11px; padding: 2px 6px; border-radius: 6px; border: 1px dashed var(--pf, var(--c-violet)); color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.free-slot:hover, .free-slot:focus-visible { color: var(--text); background: var(--surface-hover); }
.free-slot:focus-visible { outline: 2px solid var(--focus); }
.lday h3 { text-transform: capitalize; margin: var(--sp-4) 0 var(--sp-2); font-size: var(--fs-md); }
.linkish { all: unset; cursor: pointer; text-decoration: underline; text-decoration-color: var(--border-strong); }
.linkish:focus-visible { outline: 2px solid var(--focus); }

/* ---------- Médias ---------- */
.media-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
.folders { padding: var(--sp-3); position: sticky; top: 90px; }
.ftree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.fbtn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: var(--fs-sm); }
.fbtn .i { width: 16px; height: 16px; }
.fbtn:hover { background: var(--surface-hover); color: var(--text); }
.fbtn:focus-visible { outline: 2px solid var(--focus); }
.fbtn.on { background: linear-gradient(90deg, rgba(149, 98, 223, .45), rgba(212, 60, 232, .18)); color: var(--text); }
.fcount { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.factions { display: flex; gap: 6px; flex-wrap: wrap; margin: var(--sp-3) 0 var(--sp-2); }
.media-main { display: flex; flex-direction: column; gap: var(--sp-4); min-width: 0; }
.dropzone { border: 2px dashed transparent; border-radius: var(--radius-lg); transition: border-color var(--dur) var(--ease); min-height: 200px; }
.dropzone.over { border-color: var(--c-magenta); background: rgba(212, 60, 232, .06); }
.mgrid-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: var(--sp-3); }
.mcard { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.mcard.picked { border-color: var(--c-magenta); box-shadow: var(--glow); }
.mchk { position: absolute; top: 8px; left: 8px; z-index: 1; background: rgba(9, 13, 53, .75); border-radius: 6px; padding: 3px; line-height: 0; }
.mchk input { width: 16px; height: 16px; accent-color: var(--c-magenta); }
.mthumb { all: unset; cursor: pointer; display: block; position: relative; aspect-ratio: 4 / 3; background: var(--c-night); }
.mthumb:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.mthumb img, .mthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vbadge { position: absolute; right: 6px; bottom: 6px; display: inline-flex; gap: 4px; align-items: center; font-size: 11px; background: rgba(9, 13, 53, .8); padding: 2px 6px; border-radius: 6px; }
.vbadge .i { width: 14px; height: 14px; }
.mmeta { padding: 8px 10px; display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-xs); color: var(--text-muted); min-width: 0; }
.mmeta strong { color: var(--text); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mbadges { display: flex; flex-wrap: wrap; gap: 4px; }
.mdetail { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--sp-5); }
.mpreview img, .mpreview video { width: 100%; max-height: 360px; object-fit: contain; background: var(--c-night); border-radius: var(--radius); }
.variants { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--sp-3); }
.variant { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; font-size: var(--fs-xs); }
.vthumb { width: 96px; display: grid; place-items: center; background: var(--c-night); border: 1px dashed var(--border); border-radius: 6px; overflow: hidden; }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.r-1x1 { aspect-ratio: 1; } .r-4x3 { aspect-ratio: 4 / 3; } .r-4x5 { aspect-ratio: 4 / 5; } .r-16x9 { aspect-ratio: 16 / 9; } .r-9x16 { aspect-ratio: 9 / 16; width: 60px; }
.crop-canvas { max-width: 100%; border-radius: var(--radius-sm); cursor: move; touch-action: none; align-self: center; }
.crop-canvas:focus-visible { outline: 2px solid var(--focus); }
.chip-pick { all: unset; cursor: pointer; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill); border: 1px solid var(--border); }
.chip-pick.on { background: var(--grad-brand); color: #fff; border-color: transparent; }
.chip-pick:focus-visible { outline: 2px solid var(--focus); }
.pthumbs { display: flex; flex-wrap: wrap; gap: 6px; }
.pthumb { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--c-night); display: grid; place-items: center; border: 1px solid var(--border); }
.pthumb img { width: 100%; height: 100%; object-fit: cover; }
.pdel { all: unset; cursor: pointer; position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: rgba(9, 13, 53, .85); font-size: 13px; }
.pdel:focus-visible { outline: 2px solid var(--focus); }
.dlg-actions .spacer { flex: 1; }
.dlg h3 { font-size: var(--fs-md); margin: 0 0 6px; }
@media (max-width: 900px) { .media-layout, .mdetail { grid-template-columns: minmax(0, 1fr); } .folders { position: static; } }

/* ---------- Historique ---------- */
.hlist { display: flex; flex-direction: column; gap: var(--sp-3); }
.hcard { padding: 0; }
.hcard.has-err { border-color: rgba(255, 122, 150, .45); }
.hhead { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: var(--sp-3); width: 100%; padding: var(--sp-4); flex-wrap: wrap; }
.hhead:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--radius-lg); }
.hpfs { display: flex; gap: 3px; }
.htitle { display: flex; flex-direction: column; min-width: 0; flex: 1 1 260px; }
.htitle .faint { font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdate { font-size: var(--fs-xs); margin-left: auto; }
.hbody { padding: 0 var(--sp-4) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.hbody td.bad { color: var(--danger); }
.hactions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.timeline { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); }
.hkpis .kpi { padding: var(--sp-3) var(--sp-4); }
.kpi-value.bad { color: var(--danger); }

/* ---------- Statistiques ---------- */
.viz { width: 100%; height: auto; display: block; }
.viz-ax { font-size: 11px; fill: var(--viz-axis); font-family: var(--f-body); }
.viz g[data-tip]:focus-visible { outline: 2px solid var(--focus); }
.viz-tip { position: fixed; z-index: 100; pointer-events: none; background: var(--surface-solid); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 8px 10px; font-size: var(--fs-xs); color: var(--text); box-shadow: var(--shadow-card); max-width: 240px; }
.share { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.share li { display: grid; grid-template-columns: 120px 1fr 60px; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.share li:focus-visible { outline: 2px solid var(--focus); border-radius: 6px; }
.share-name { display: inline-flex; gap: 6px; align-items: center; color: var(--text-muted); }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.share-bar { height: 10px; background: rgba(149, 98, 223, .12); border-radius: 0 4px 4px 0; overflow: hidden; }
.share-bar span { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.share-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.top { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-size: var(--fs-sm); }
.top li { display: flex; flex-direction: column; gap: 2px; }
.top li > span:nth-child(3) { color: var(--text-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.heat { display: flex; flex-direction: column; gap: 2px; overflow-x: auto; }
.heat-row { display: grid; grid-template-columns: 34px repeat(24, minmax(12px, 1fr)); gap: 2px; align-items: center; }
.heat-h, .heat-d { font-size: 10px; color: var(--viz-axis); }
.heat-c { height: 18px; border-radius: 3px; background: rgba(149, 98, 223, var(--a)); }
.heat-c.empty { background: rgba(149, 98, 223, .05); }
.heat-c:focus-visible { outline: 2px solid var(--focus); }
details.card > summary { cursor: pointer; }

/* ---------- Publication assistée ---------- */
.assist-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.assist { padding: var(--sp-3); border-radius: var(--radius); border: 1px solid var(--border); background: rgba(9, 13, 53, .45); display: flex; flex-direction: column; gap: var(--sp-2); }
.assist.due { border-color: rgba(255, 194, 102, .5); }
.assist-head { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.assist-text { margin: 0; max-height: 140px; overflow: auto; background: var(--surface-solid); padding: var(--sp-3); border-radius: var(--radius-sm); font-size: var(--fs-sm); }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--sp-4); }
.login form { width: min(380px, 100%); }
.login h1 { font-size: var(--fs-2xl); }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-a, .row-b, .compose-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; width: min(280px, 86vw); transform: translateX(-105%); transition: transform var(--dur) var(--ease); }
  .app.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(3, 5, 28, .6); z-index: 20; display: none; }
  .app.nav-open .scrim { display: block; }
  .menu-btn { display: inline-grid; }
  .topbar { flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); gap: var(--sp-3); }
  .topbar .space-label { display: none; }
  .search { order: 5; max-width: none; flex-basis: 100%; margin-left: 0; }
  .notif { margin-left: auto; }
  #view { padding: var(--sp-4); gap: var(--sp-4); }
  .hero { padding: var(--sp-5); min-height: 180px; }
  .hero h1 { font-size: var(--fs-2xl); }
  .hero-kicker { font-size: var(--fs-xl); }
  .hero-art .sun { width: 110px; height: 110px; right: 6%; }
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .card { padding: var(--sp-4); }
  .composer .seg button span { display: none; }
  .hero-art .city { opacity: .35; width: 70%; }
  .hero-art .halo { opacity: .5; }
}
