/* EffaImmo — back-office
   Palette « plaque émaillée » : bleu ardoise des plaques de rue, pierre claire, laiton des boîtes aux lettres. */
:root {
  --slate: #14424A;
  --slate-deep: #0D2E34;
  --slate-soft: #E3ECEC;
  --stone: #EEF1EF;
  --paper: #FFFFFF;
  --ink: #1B2A2E;
  --muted: #5D6D71;
  --line: #D6DEDC;
  --brass: #B98A2E;
  --ok: #2E7A57; --ok-bg: #E3F2EA;
  --warn: #9A6412; --warn-bg: #FBF0DC;
  --bad: #AE3B2A; --bad-bg: #FBE6E2;
  --info: #285E8E; --info-bg: #E3EEF8;
  --radius: 10px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Young Serif", Georgia, serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 15px; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--stone); line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--slate); }
a:hover { color: var(--slate-deep); }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 2px; border-radius: 4px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.neg { color: var(--bad); }
.yes { color: var(--ok); font-weight: 600; }
code, pre.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85em; background: var(--slate-soft); padding: 2px 6px; border-radius: 4px; }
pre.code { padding: 12px; overflow-x: auto; }

/* ---------- Plaque (logo) ---------- */
.plaque { display: inline-grid; place-items: center; width: 44px; height: 32px; background: var(--slate); color: #fff; font-family: var(--serif); font-size: 15px; border-radius: 7px; box-shadow: inset 0 0 0 2px var(--slate), inset 0 0 0 3.5px #fff; letter-spacing: .02em; flex: none; }
.plaque.big { width: 88px; height: 62px; font-size: 28px; border-radius: 12px; box-shadow: inset 0 0 0 3px var(--slate), inset 0 0 0 5.5px #fff; }

/* ---------- Structure ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: var(--slate-deep); color: #D7E3E3; overflow-y: auto; z-index: 40; padding-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 18px 16px; color: #fff; text-decoration: none; }
.brand .plaque { box-shadow: inset 0 0 0 2px var(--slate), inset 0 0 0 3.5px #fff; }
.brand-text { font-weight: 700; line-height: 1.15; }
.brand-text small { display: block; font-weight: 500; color: #9DB6B8; font-size: 12px; }
.nav-group { padding: 6px 10px; }
.nav-title { margin: 10px 10px 2px; font-size: 12px; color: #8FA9AB; font-weight: 600; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 8px; color: #D7E3E3; text-decoration: none; font-weight: 500; position: relative; }
.sidebar nav a i { width: 18px; text-align: center; color: #8FB0B3; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.1); color: #fff; }
.sidebar nav a.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--brass); }
.sidebar nav a.active i { color: var(--brass); }
.pill { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 700; min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.16); color: #fff; }
.pill.bad { background: var(--bad); }
.pill.info { background: var(--brass); }
.shell { margin-left: 248px; min-height: 100vh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 14px; padding: 10px 28px; background: rgba(238,241,239,.92); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.menu-toggle { display: none; }
.global-search { flex: 1; max-width: 520px; position: relative; }
.global-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.global-search input { width: 100%; padding: 9px 12px 9px 36px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font: inherit; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; font-size: 15px; }
.icon-btn:hover { background: var(--slate-soft); }
.icon-btn.danger { color: var(--bad); }
.bell .dot { position: absolute; top: 3px; right: 2px; font-style: normal; font-size: 10px; font-weight: 700; background: var(--bad); color: #fff; border-radius: 999px; padding: 0 5px; line-height: 16px; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu summary:hover { background: var(--slate-soft); }
.avatar { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--slate); color: #fff; font-weight: 700; font-size: 13px; }
.who { line-height: 1.1; font-weight: 600; }
.who small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.usermenu .menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--paper); border: 1px solid var(--line); border-radius: 10px; min-width: 200px; padding: 6px; box-shadow: 0 12px 30px rgba(13,46,52,.12); }
.usermenu .menu a, .usermenu .menu button { display: flex; gap: 10px; align-items: center; width: 100%; padding: 8px 10px; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: none; border-radius: 6px; cursor: pointer; text-align: left; }
.usermenu .menu a:hover, .usermenu .menu button:hover { background: var(--stone); }
.content { padding: 24px 28px 48px; max-width: 1440px; width: 100%; }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-family: var(--serif); font-weight: 400; font-size: 1.85rem; line-height: 1.15; margin: 2px 0 4px; letter-spacing: -.005em; }
.sub { margin: 0; color: var(--muted); }
.crumb { font-size: 13px; color: var(--muted); text-decoration: none; }
.crumb:hover { color: var(--slate); text-decoration: underline; }
.tags { margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { margin: 0; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 15px; border-radius: 8px; border: 1px solid transparent; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn.primary { background: var(--slate); color: #fff; }
.btn.primary:hover { background: var(--slate-deep); color: #fff; }
.btn.ghost { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn.ghost:hover { border-color: var(--slate); color: var(--slate); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger-ghost { background: var(--paper); border-color: #E7C2BB; color: var(--bad); }
.btn.danger-ghost:hover { background: var(--bad-bg); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--slate); font-weight: 600; text-decoration: none; cursor: pointer; font-size: 14px; }
.btn-link:hover { text-decoration: underline; }

/* ---------- Alertes & badges ---------- */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.alert.success { background: var(--ok-bg); border-color: #BFE0CD; color: #1D5A3E; }
.alert.error { background: var(--bad-bg); border-color: #EFC3BA; color: #8A2A1C; }
.alert.info { background: var(--info-bg); border-color: #C3D8EC; color: #1F4B73; }
.action-alert { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.action-alert form { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tone-ok { background: var(--ok-bg); color: var(--ok); }
.tone-warn { background: var(--warn-bg); color: var(--warn); }
.tone-bad { background: var(--bad-bg); color: var(--bad); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-mute { background: #E7ECEB; color: #55676B; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { display: flex; flex-direction: column; gap: 2px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: inherit; }
a.kpi:hover { border-color: var(--slate); }
.kpi-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi strong { font-size: 1.45rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi-hint { font-size: 12.5px; color: var(--muted); }
.kpi.bad strong { color: var(--bad); }
.kpi.warn strong { color: var(--warn); }
.kpis.small .kpi strong { font-size: 1.15rem; }

/* ---------- Panneaux ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 16px; }
.panel h2 { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.panel h3 { font-size: .95rem; margin: 18px 0 8px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-head h2 { margin: 0; }
.count { display: inline-block; min-width: 22px; text-align: center; font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--slate-soft); color: var(--slate); vertical-align: 2px; }
.panel.narrow { max-width: 720px; }
.dash-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.dash-grid .panel { margin: 0; }
.span-2 { grid-column: span 2; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two-col .panel { margin-bottom: 16px; }
.chart-box { position: relative; height: 260px; }
.legend { font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 2px; }
.sw.in { background: var(--slate); }
.sw.out { background: var(--brass); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--stone); }
.list li:first-child { border-top: 0; }
.list li a { text-decoration: none; color: inherit; display: flex; flex-direction: column; min-width: 0; }
.list li a:hover strong { color: var(--slate); text-decoration: underline; }
.list li span { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list li.unread strong::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brass); margin-right: 7px; vertical-align: 1px; }
ul.list.panel li { padding: 12px 0; }

/* ---------- Filtres & tableaux ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters input[type=search] { flex: 1 1 240px; max-width: 360px; }
.filters input, .filters select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--paper); }
.table-wrap { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.panel .table-wrap { border: 0; border-radius: 0; margin: 0 -20px -18px; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; font-weight: 600; font-size: 13px; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #F7F9F8; }
table.data th a { color: inherit; text-decoration: none; }
table.data th a:hover { color: var(--slate); }
table.data td { padding: 10px 12px; border-bottom: 1px solid #EDF1F0; vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr[data-href] { cursor: pointer; }
table.data tbody tr:hover { background: #F6F9F8; }
table.data.compact td, table.data.compact th { padding: 8px 12px; }
table.data .num, .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.act, table.data th.act { width: 44px; text-align: right; }
.rowlink { color: var(--ink); text-decoration: none; font-weight: 600; }
.rowlink:hover { color: var(--slate); text-decoration: underline; }
.pager { display: flex; gap: 4px; justify-content: center; margin: 16px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); text-decoration: none; color: var(--ink); font-size: 14px; }
.pager span[aria-current] { background: var(--slate); color: #fff; border-color: var(--slate); }
.empty { background: var(--paper); border: 1px dashed #C3CFCC; border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--muted); }
.empty p { max-width: 520px; margin: 0 auto 14px; }

/* ---------- Formulaires ---------- */
.form-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 22px 20px; margin-bottom: 16px; }
fieldset { border: 0; padding: 0; margin: 18px 0 8px; }
legend { font-weight: 700; font-size: 1rem; padding: 0; margin-bottom: 12px; color: var(--slate-deep); }
.form-card fieldset + fieldset { border-top: 1px solid var(--stone); padding-top: 18px; }
.grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px 16px; }
.w-full { grid-column: span 6; }
.w-half { grid-column: span 3; }
.w-third { grid-column: span 2; }
.field label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; }
.req { color: var(--bad); }
.field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea, .inline-form input, .inline-form select {
  width: 100%; padding: 9px 11px; border: 1px solid #C9D3D1; border-radius: 8px; font: inherit; background: var(--paper); color: var(--ink); }
.field textarea { resize: vertical; min-height: 90px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--slate); outline: 2px solid rgba(20,66,74,.15); outline-offset: 0; }
.field input[readonly] { background: var(--stone); color: var(--muted); }
.help { display: block; color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.affix { display: flex; }
.affix input { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; }
.affix span { display: grid; place-items: center; padding: 0 11px; background: var(--stone); border: 1px solid #C9D3D1; border-left: 0; border-radius: 0 8px 8px 0; color: var(--muted); font-size: 13px; }
.field-bool { align-self: end; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500 !important; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--slate); }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.form-actions .help { margin-right: auto; margin-top: 0; }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 12px; }
.inline-form input, .inline-form select { width: auto; }
.inline-form label { font-weight: 600; }
.danger-zone { margin-top: 14px; border-top: 1px solid var(--stone); padding-top: 10px; }
.danger-zone summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.danger-zone form { margin-top: 12px; }

/* ---------- Fiches ---------- */
.detail { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
dl.kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px; margin: 0; }
dl.kv div.wide { grid-column: 1 / -1; }
dl.kv dt { font-size: 12.5px; color: var(--muted); font-weight: 600; }
dl.kv dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.message-body p:first-child { font-size: 1.05rem; line-height: 1.65; max-width: 72ch; }

/* ---------- Photos ---------- */
.photo-grid { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.photo-grid li { position: relative; border-radius: 8px; overflow: hidden; background: var(--stone); aspect-ratio: 4/3; border: 1px solid var(--line); }
.photo-grid li.cover { outline: 3px solid var(--brass); outline-offset: -3px; }
.photo-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-tag { position: absolute; left: 8px; top: 8px; background: var(--brass); color: #fff; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.photo-actions { position: absolute; inset: auto 0 0 0; display: flex; justify-content: flex-end; gap: 2px; padding: 4px; background: linear-gradient(transparent, rgba(13,46,52,.75)); }
.photo-actions form { margin: 0; }
.photo-actions .icon-btn { color: #fff; width: 30px; height: 30px; font-size: 13px; }
.photo-actions .icon-btn:hover { background: rgba(255,255,255,.2); }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.bars { list-style: none; padding: 0; margin: 0; }
.bars li { display: grid; grid-template-columns: 170px 1fr auto; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.bars i { display: block; height: 10px; border-radius: 3px; background: var(--slate-soft); position: relative; }
.bars i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--slate); border-radius: 3px; }
.bars b { font-variant-numeric: tabular-nums; }

/* ---------- Connexion / installation ---------- */
.login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: var(--slate-deep); }
.login-card { width: 100%; max-width: 420px; background: var(--paper); border-radius: 14px; padding: 32px 30px 26px; }
.login-card.wide { max-width: 760px; }
.login-card h1 { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; margin: 18px 0 4px; }
.login-card .sub { margin-bottom: 18px; }
.login-card .field { margin-bottom: 14px; }
.login-card .foot { text-align: center; margin: 18px 0 0; font-size: 14px; }
.log { padding-left: 18px; color: var(--muted); font-size: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dash-grid, .two-col, .detail { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .sidebar.open { transform: none; }
  .shell { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 8px 14px; }
  .content { padding: 18px 14px 40px; }
  .who { display: none; }
  .grid { grid-template-columns: 1fr 1fr; }
  .w-full, .w-half { grid-column: span 2; }
  .w-third { grid-column: span 1; }
  .bars li { grid-template-columns: 110px 1fr auto; }
}
@media (max-width: 520px) {
  .grid { grid-template-columns: 1fr; }
  .w-full, .w-half, .w-third { grid-column: span 1; }
  .page-head h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .sidebar, .topbar, .actions, .filters, .pager, .menu-toggle { display: none !important; }
  .shell { margin: 0; }
  body { background: #fff; }
  .panel, .kpi, .table-wrap { break-inside: avoid; border-color: #ccc; }
}

/* ---------- Agenda ---------- */
.agenda-head { margin-bottom: 12px; }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: 8px 0 0 8px; margin-left: 0; }
.seg .btn:last-child { border-radius: 0 8px 8px 0; }
.seg .btn.primary { position: relative; z-index: 1; }
.agenda-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); font: inherit; font-size: 13.5px; cursor: pointer; color: var(--ink); }
.chip[aria-pressed=false] { opacity: .45; text-decoration: line-through; background: transparent; }
.ev-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; align-items: start; }
.agenda-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.agenda-side .panel { margin: 0; padding: 14px 16px; }
.agenda-side h2 { font-size: .95rem; margin-bottom: 8px; }
.agenda-side .ev { margin-bottom: 4px; }
.side-day { font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 10px 0 4px; }
.side-add { display: flex; flex-wrap: wrap; gap: 6px; }

/* Mois */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--line); gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: #F7F9F8; padding: 7px 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.cal-dow.we { color: #8A9A97; }
.cal-day { background: var(--paper); min-height: 96px; padding: 5px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cal-day.we { background: #FBFCFC; }
.cal-day.out { background: #F6F8F7; }
.cal-day.out .cal-num, .cal-day.past .cal-num { color: #9AA8A5; }
.cal-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1px; }
.cal-num { font-size: 12.5px; font-weight: 700; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); text-decoration: none; }
.cal-num:hover { background: var(--stone); }
.cal-day.today .cal-num { background: var(--slate); color: #fff; }
.cal-day.today { box-shadow: inset 0 0 0 2px var(--slate); }
.quick { position: relative; }
.quick summary { list-style: none; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--muted); font-size: 11px; cursor: pointer; opacity: 0; }
.quick summary::-webkit-details-marker { display: none; }
.cal-day:hover .quick summary, .quick summary:focus-visible, .quick[open] summary { opacity: 1; }
.quick summary:hover { background: var(--slate-soft); color: var(--slate); }
.quick-menu { position: absolute; right: 0; top: 24px; z-index: 5; background: var(--paper); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 24px rgba(13,46,52,.14); padding: 4px; min-width: 130px; }
.quick-menu a { display: block; padding: 6px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 13.5px; }
.quick-menu a:hover { background: var(--stone); }

/* Événements */
.ev { display: block; font-size: 12px; line-height: 1.3; padding: 3px 6px; border-radius: 5px; text-decoration: none; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 3px solid; }
.ev small { display: block; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
.ev:hover { filter: brightness(.96); }
.ev-more { font-size: 11.5px; color: var(--slate); padding-left: 6px; font-weight: 600; text-decoration: none; }
.ev-visit { background: #E3EEF8; border-color: #285E8E; } .ev-dot.ev-visit { background: #285E8E; }
.ev.req { background: repeating-linear-gradient(135deg, #E3EEF8 0 6px, #F1F6FB 6px 12px); }
.ev-work { background: #FBF0DC; border-color: #B7791F; } .ev-dot.ev-work { background: #B7791F; }
.ev-task { background: #E3ECEC; border-color: var(--slate); } .ev-dot.ev-task { background: var(--slate); }
.ev-task.done { background: #F1F3F2; border-color: #AAB6B4; color: var(--muted); text-decoration: line-through; }
.ev-lease { background: #FBE6E2; border-color: var(--bad); } .ev-dot.ev-lease { background: var(--bad); }
.ev-more.ev, .ev.ev-more { background: var(--stone); border-color: #AAB6B4; color: var(--slate); font-weight: 700; text-align: center; }
.ev-rent { background: #E3F2EA; border-color: var(--ok); } .ev-dot.ev-rent { background: var(--ok); }
.agenda.hide-visit .ev-visit, .agenda.hide-work .ev-work, .agenda.hide-task .ev-task, .agenda.hide-lease .ev-lease, .agenda.hide-rent .ev-rent { display: none; }
.agenda.hide-visit .week-ev:has(.ev-visit), .agenda.hide-work .week-ev:has(.ev-work), .agenda.hide-task .week-ev:has(.ev-task) { display: none; }

/* Semaine */
.week { --row: 46px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.week-head, .week-allday, .week-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(0, 1fr)); }
.week-head { border-bottom: 1px solid var(--line); background: #F7F9F8; }
.week-head a { padding: 8px; text-align: center; font-size: 13px; color: var(--muted); text-decoration: none; border-left: 1px solid var(--line); }
.week-head a b { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 50%; color: var(--ink); font-size: 14px; }
.week-head a.today b { background: var(--slate); color: #fff; }
.week-allday { border-bottom: 1px solid var(--line); min-height: 34px; }
.week-allday > span { font-size: 11px; color: var(--muted); padding: 8px 4px; text-align: right; }
.week-allday > div { border-left: 1px solid var(--line); padding: 3px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.week-grid { position: relative; max-height: calc(100vh - 290px); overflow-y: auto; }
.week-hours span { display: block; height: var(--row); font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; }
.week-col { position: relative; border-left: 1px solid var(--line); min-width: 0; }
.week-col.we { background: #FBFCFC; }
.week-col.today { background: #F4F8F8; }
.slot { display: block; height: var(--row); border-top: 1px solid #EEF2F1; }
a.slot:hover { background: rgba(20,66,74,.05); }
.week-ev { position: absolute; top: calc(var(--top) / 60 * var(--row) + 1px); height: calc(var(--row) - 3px);
  left: calc(3px + (100% - 6px) * var(--lane) / var(--lanes)); width: calc((100% - 6px) / var(--lanes) - 2px); z-index: 2; }
.week-ev.with-more { width: calc(100% - 50px); }
.week-ev.more { left: auto; right: 3px; width: 40px; }
.week-ev.more .ev { padding: 3px 2px; font-size: 12px; }
.week-ev.more .ev small { display: none; }
.week-ev:hover, .week-ev:focus-within { z-index: 4; height: auto; min-height: calc(var(--row) - 3px); }
.week-ev .ev { height: 100%; white-space: normal; overflow: hidden; box-shadow: 0 1px 2px rgba(13,46,52,.08); }
.now { position: absolute; left: 0; right: 0; top: calc(var(--top) / 60 * var(--row)); height: 2px; background: var(--bad); z-index: 3; }
.now::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* Liste */
.agenda-list .day-block { padding: 10px 0; border-top: 1px solid var(--stone); display: flex; flex-direction: column; gap: 4px; }
.agenda-list .day-block:first-child { border-top: 0; padding-top: 0; }
.agenda-list .day-block h2 { font-size: .95rem; margin: 0 0 4px; }
.agenda-list .ev { white-space: normal; font-size: 13.5px; padding: 6px 10px; }

@media (max-width: 1200px) { .agenda-layout { grid-template-columns: 1fr; } .agenda-side { position: static; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); } }
@media (max-width: 860px) {
  .cal-day { min-height: 64px; padding: 3px; }
  .cal-day .ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; border-radius: 3px; }
  .cal-day .ev b { display: none; }
  .quick { display: none; }
  .week-head, .week-allday, .week-grid { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
  .week-ev .ev { font-size: 10.5px; padding: 2px; }
}

/* ---------- Sondages ---------- */
.copy-row { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font: inherit; background: var(--stone); }
.poll-inputs { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.poll-inputs input { padding: 9px 11px; border: 1px solid #C9D3D1; border-radius: 8px; font: inherit; }
.poll-results li { grid-template-columns: minmax(120px, 1fr) 2fr auto; }
.lede-admin { max-width: 72ch; color: var(--muted); margin: -8px 0 16px; }
