:root { --primary:#2563eb; --danger:#ef4444; }
* { box-sizing: border-box; }
body { margin:0; font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif; background:#f6f8fb; color:#111827; }
.container { margin: 0 auto; padding: 20px; }
.container.narrow { max-width: 520px; }
.topbar { background:#ffffff; border-bottom:1px solid #e5e7eb; }
.topbar .brand { font-weight:700; text-decoration:none; color:#111827; }
.topbar .spread { display:flex; align-items:center; justify-content:space-between; gap:16px; }
.topbar.public { top:0; z-index:2; }v
.footer { border-top:1px solid #e5e7eb; background:#fff; padding:20px 0; margin-top:40px; }

h1,h2,h3 { margin: 0 0 10px; }
label { display:block; font-size:14px; color:#334155; margin-bottom:10px; }
label input, label textarea, label select { width:100%; padding:10px; border:1px solid #e5e7eb; border-radius:8px; margin-top:6px; background:#fff; }

.btn { background: var(--primary); color:#fff; border: none; padding:10px 14px; border-radius:10px; text-decoration:none; display:inline-block; cursor:pointer; }
.btn:hover { filter: brightness(0.95); }
.btn-light { background:#f3f4f6; color:#111827; }
.btn-danger { background: var(--danger); color:#fff; }
.alert { padding:10px 12px; border-radius:8px; }
.alert-danger { background:#fee2e2; color:#991b1b; }

.toolbar { display:flex; gap:10px; align-items:center; margin:16px 0; }
.toolbar.spread { justify-content: space-between; }
.toolbar.right { justify-content: flex-end; }
.grid-2 { display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:16px; }
@media (max-width: 720px){ .grid-2 { grid-template-columns: 1fr; } }

.cards { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap:16px; }
.card { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:16px; }
.card .row-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }

/* Timeline */
.timeline { display: grid; gap: 14px; }
@media (min-width: 1024px) { .timeline { grid-auto-flow: column; grid-auto-columns: minmax(800px, 1fr); width: 100%; overflow: auto;} }
.month-col { background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:10px; }
.month-title { font-weight:700; margin-bottom:8px; position:sticky; top:0; background:#fff; }
.events { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:10px; }
.event { position:relative; display:flex; gap:10px; align-items:flex-start; }
.event-line { width:8px; border-radius:999px; background:#dbeafe; flex:0 0 8px; margin:6px 0 0 2px; }
.event-card { background:#f9fafb; border:1px solid #e5e7eb; border-radius:10px; padding:8px 10px; flex:1; }
.event-head { font-size:14px; margin-bottom:6px; }
.event-date { color:#111827; font-variant-numeric: tabular-nums; }
.event-meta { display:grid; gap:6px; margin:6px 0; }
.event-channels { display:flex; flex-wrap:wrap; gap:6px; }
.ch-badge { display:inline-flex; align-items:center; gap:8px; padding:6px 10px; background:#fff; border:1px solid #e5e7eb; border-radius:999px; font-size:12px; }
.ch-ico { width:16px; height:16px; display:inline-block; }
.ch-name { font-weight:600; }
.event-footer { margin-top:6px; color:#111827; font-weight:600; }

/* Admin channels grid */
.channels-grid { display:flex; gap:10px; }
.channel-check { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid #e5e7eb; border-radius:10px; background:#fff; }
.channel-check input { transform: translateY(1px); }
/* Ergonomics v3.1 */
.hint { color:#6b7280; font-size:12px; margin:6px 0 12px; }
.action-card { position:relative; padding-left:42px; }
.card-handle { position:absolute; left:10px; top:12px; cursor:grab; user-select:none; opacity:.6; }
.action-card.dragging { opacity:.6; }
.action-card.drag-over { outline: 2px dashed #2563eb; }

.action-summary { font-weight:600; }
.action-grid .inline { display:flex; gap:8px; align-items:center; }
.btn-quick .btn-xs { padding:4px 8px; border-radius:8px; }
.btn-xs { font-size:12px; padding:6px 8px; border-radius:8px; }

.chips { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:6px; }
.chip { padding:6px 10px; border:1px solid #e5e7eb; border-radius:999px; background:#fff; cursor:pointer; }
.chip.active { background:#2563eb; color:#fff; border-color:#2563eb; }

.muted { color:#6b7280; }
/* --- Client viewer ergonomics --- */
.viewer-toolbar { position:sticky; top:0px; z-index:3; background:#fff; border:1px solid #e5e7eb; border-radius:12px; padding:10px; display:flex; gap:12px; align-items:flex-start; flex-wrap:wrap; }
.viewer-filters { display:flex; gap:10px; flex-wrap:wrap; flex:1; }
.viewer-actions { display:flex; gap:8px; }
.viewer-summary { color:#374151; margin:10px 0 16px; }

#searchInput { min-width:260px; padding:10px; border:1px solid #e5e7eb; border-radius:10px; }

.chips { display:flex; gap:6px; flex-wrap:wrap; }
.chip { padding:6px 10px; border:1px solid #e5e7eb; border-radius:999px; background:#fff; cursor:pointer; font-size:12px; }
.chip.active { background:#2563eb; color:#fff; border-color:#2563eb; }
.chip-clear { background:#f3f4f6; }

.month-nav { z-index:2; display:flex; gap:8px; flex-wrap:wrap; margin:12px 0; }
.month-nav a { padding:6px 10px; border-radius:999px; background:#f3f4f6; text-decoration:none; color:#111827; font-size:12px; }
.month-nav a.active { background:#2563eb; color:#fff; }

/* Vue liste (agenda) */
.viewer-list .timeline { grid-auto-flow: row; grid-auto-columns: unset; }
.viewer-list .month-col { width:100%; }
.viewer-list .event-line { display:none; }
.viewer-list .event-card { background:#fff; }

/* Impression propre */
@media print {
    .topbar, .viewer-toolbar, .month-nav, #comments { display:none !important; }
    .event-card { background:#fff; border-color:#ddd; }
    .timeline { grid-auto-flow: row !important; }
}

