/* SYNESS 360 — Agenda, réunions et messagerie interne (lot 5) */

/* ---------- Agenda ---------- */
.ag-bar { gap: 10px; }
.ag-bar select { min-width: 190px; }
.ag-period { font-size: .95rem; white-space: nowrap; }
.ag-types { padding-top: 8px; padding-bottom: 8px; gap: 6px; background: var(--surface-2); }
.ag-type { cursor: pointer; position: relative; }
.ag-type input { position: absolute; opacity: 0; width: 0; height: 0; }
.ag-type span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .8rem; color: var(--muted); }
.ag-type input:checked + span { color: var(--ink); border-color: currentColor; font-weight: 600; }
.ag-type.t-reunion input:checked + span { background: var(--brand-tint); color: var(--brand-ink); }
.ag-type.t-rendez_vous input:checked + span { background: var(--info-bg); color: var(--info); }
.ag-type.t-tache input:checked + span { background: var(--warn-bg); color: var(--warn); }
.ag-type.t-arret input:checked + span { background: var(--neutral-bg); color: var(--neutral); }
.ag-type input:focus-visible + span { box-shadow: var(--ring); }

.ag-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-height: 420px; }
.ag-day { border-right: 1px solid var(--line); min-width: 0; display: flex; flex-direction: column; }
.ag-day:last-child { border-right: 0; }
.ag-day.we { background: var(--surface-2); }
.ag-dh { display: flex; align-items: baseline; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.ag-dh b { font-size: 1.15rem; color: var(--ink); }
.ag-dh em { margin-left: auto; font-style: normal; font-size: .7rem; background: var(--neutral-bg); border-radius: 9px; padding: 0 7px; }
.ag-day.today .ag-dh { color: var(--brand-ink); }
.ag-day.today .ag-dh b { background: var(--brand); color: #fff; border-radius: 50%; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; }
.ag-dl { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ag-none { color: var(--line-strong); text-align: center; padding: 14px 0; font-size: .8rem; }

.ag-ev { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: var(--radius); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); background: var(--surface); color: var(--ink); text-decoration: none; font-size: .8rem; min-width: 0; transition: box-shadow .12s, border-color .12s; }
.ag-ev:hover { box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.ag-ev .ag-time { font-weight: 700; font-size: .74rem; color: var(--muted); }
.ag-ev .ag-title { font-weight: 600; display: flex; gap: 6px; align-items: baseline; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ag-ev .ag-title i { font-size: .72rem; margin-right: 5px; }
.ag-ev .ag-sub { color: var(--muted); font-size: .74rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-ev .ag-flag { align-self: flex-start; margin-top: 3px; font-size: .68rem; font-weight: 700; color: var(--warn); background: var(--warn-bg); border-radius: 8px; padding: 1px 7px; }
.ag-ev.t-reunion { border-left-color: var(--brand); }
.ag-ev.t-reunion .ag-title i { color: var(--brand); }
.ag-ev.t-rendez_vous { border-left-color: var(--info); }
.ag-ev.t-rendez_vous .ag-title i { color: var(--info); }
.ag-ev.t-tache { border-left-color: var(--accent); }
.ag-ev.t-tache .ag-title i { color: var(--warn); }
.ag-ev.t-arret { border-left-color: var(--neutral); background: var(--surface-2); }
.ag-ev.done { opacity: .62; }
.ag-ev.done .ag-title { text-decoration: line-through; text-decoration-color: var(--line-strong); }
.ag-ev.late { border-left-color: var(--bad); }
.ag-ev.late .ag-time { color: var(--bad); }

.ag-list { padding: 6px 14px 14px; }
.ag-lday { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.ag-lday:last-child { border-bottom: 0; }
.ag-lh { font-weight: 700; font-size: .86rem; color: var(--ink-2); display: flex; align-items: center; gap: 8px; text-transform: capitalize; }
.ag-lday.today .ag-lh { color: var(--brand-ink); }
.ag-list .ag-ev { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.ag-list .ag-ev .ag-time { min-width: 46px; }
.ag-list .ag-ev .ag-title { flex: 1 1 200px; }
.ag-list .ag-ev .ag-sub { flex: 0 1 auto; }

.ag-report li { padding: 10px 16px; }
.ag-report a { color: inherit; flex-wrap: nowrap; }
.ag-people li { display: flex; align-items: center; gap: 10px; padding: 10px 16px; flex-wrap: wrap; }
.ag-people .grow { min-width: 160px; }
.ag-st { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.ag-ext { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr auto auto; gap: 6px; align-items: center; margin-bottom: 6px; }
.ag-ext input { min-width: 0; }
.ag-wa { align-items: center; color: var(--wa); }
.ag-wa .box { margin-top: 0; }

@media (max-width: 1100px) {
  .ag-ev .ag-sub { display: none; }
}
@media (max-width: 720px) {
  .ag-bar .grow { display: none; }
  .ag-bar select { flex: 1 1 100%; min-width: 0; }
  .ag-period { flex: 1 1 auto; text-align: right; }
  .ag-week { grid-template-columns: 1fr; min-height: 0; }
  .ag-day { border-right: 0; border-bottom: 1px solid var(--line); }
  .ag-dh { padding: 8px 12px; }
  .ag-dl { padding: 8px 12px 10px; }
  .ag-none { text-align: left; padding: 2px 0; }
  .ag-ev .ag-sub { display: block; }
  .ag-list { padding: 4px 12px 12px; }
  .ag-ext { grid-template-columns: 1fr 1fr; }
  .ag-ext input[name=ext_email] { grid-column: 1 / -1; }
  .ag-st { justify-content: flex-start; width: 100%; padding-left: 44px; }
}

/* ---------- Messagerie ---------- */
.cl-chat { overflow: hidden; }
.cl-chat .inbox { height: calc(100vh - var(--top-h) - 150px); min-height: 480px; }
.cl-search { position: relative; padding: 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; z-index: 2; }
.cl-search i { position: absolute; left: 22px; top: 22px; color: var(--muted); font-size: .8rem; }
.cl-search input { padding-left: 32px; height: 36px; }
.cl-conv { color: inherit; text-decoration: none; align-items: center; }
.cl-conv.active { background: var(--brand-soft); box-shadow: inset 3px 0 0 var(--brand); }
.cl-conv.unread strong { color: var(--ink); }
.cl-conv.unread .small { color: var(--ink-2); font-weight: 600; }
.cl-ci { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cl-ci .row { flex-wrap: nowrap; gap: 6px; }
.cl-ct strong { font-size: .88rem; }
.cl-av { width: 38px; height: 38px; }
.cl-av.k-general { background: var(--ink-2); color: #fff; }
.cl-av.k-equipe { background: var(--brand); color: #fff; }
.cl-av.k-groupe { background: var(--info-bg); color: var(--info); }
.cl-un { min-width: 20px; height: 20px; border-radius: 10px; background: var(--brand); color: #fff; font-size: .7rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; flex: 0 0 auto; }
.cl-at { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.side-nav a .cl-cnt, .bottom-nav a .cl-cnt { background: var(--bad); }
.bottom-nav a { position: relative; }
.bottom-nav a .cl-cnt { position: absolute; top: 4px; left: 54%; color: #fff; border-radius: 9px; font-size: .62rem; padding: 0 5px; line-height: 16px; min-width: 16px; text-align: center; }

.cl-body { background: var(--surface-2); gap: 2px; padding: 14px 16px; }
.cl-more { text-align: center; margin-bottom: 8px; }
.cl-empty { text-align: center; margin: auto; }
.cl-day { display: flex; align-items: center; gap: 10px; margin: 12px 0 6px; color: var(--muted); font-size: .74rem; font-weight: 600; }
.cl-day::before, .cl-day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.cl-sys { align-self: center; font-size: .76rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 3px 12px; margin: 6px 0; text-align: center; }

.cl-msg { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 0 10px; align-items: start; padding: 6px 4px 2px; border-radius: var(--radius); position: relative; }
.cl-msg:hover { background: rgba(54,153,140,.05); }
.cl-msg.grouped { padding-top: 1px; }
.cl-msg.grouped .cl-mb { grid-column: 2; }
.cl-mav { width: 34px; height: 34px; font-size: .74rem; }
.cl-msg.mine .cl-mav { background: var(--brand); color: #fff; }
.cl-mb { min-width: 0; grid-column: 2; }
.cl-mh { display: flex; gap: 8px; align-items: baseline; font-size: .84rem; margin-bottom: 2px; }
.cl-bubble { font-size: .9rem; line-height: 1.45; color: var(--ink); word-wrap: break-word; overflow-wrap: anywhere; }
.cl-txt { white-space: pre-wrap; }
.cl-txt a { word-break: break-all; }
.cl-msg.deleted .cl-bubble { font-style: italic; font-size: .82rem; }
.cl-ment { background: var(--brand-tint); color: var(--brand-ink); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.cl-ment.me { background: #FBE7BF; color: var(--warn); }
.cl-mf { display: flex; gap: 8px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.cl-replies { border: 0; background: none; color: var(--brand-ink); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; padding: 2px 0; display: inline-flex; gap: 6px; align-items: center; }
.cl-replies:hover { text-decoration: underline; }
.cl-act { width: 30px; height: 30px; opacity: 0; grid-column: 3; grid-row: 1 / span 3; }
.cl-msg:hover .cl-act, .cl-act:focus-visible { opacity: 1; }
@media (hover: none) { .cl-act { opacity: .55; } }

.cl-voice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cl-audio { height: 34px; max-width: 100%; width: 280px; }
.cl-tr { margin-top: 4px; font-size: .84rem; color: var(--ink-2); background: var(--surface); border-left: 3px solid var(--line-strong); padding: 4px 10px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.cl-tr i { color: var(--line-strong); font-size: .7rem; }
.cl-tr.muted { background: none; border: 0; padding: 0; }
.cl-file, .cl-call, .cl-sh { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-width: 420px; margin-top: 2px; color: inherit; text-decoration: none; }
.cl-file > i { font-size: 1.5rem; color: var(--bad); }
.cl-file .fa-file-excel { color: var(--ok); }
.cl-file .fa-file-word { color: var(--info); }
.cl-call { border-color: var(--brand); background: var(--brand-soft); }
.cl-call > i, .cl-sh > i:first-child { width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.cl-sh:hover { border-color: var(--brand); box-shadow: var(--shadow-1); }
.cl-sh.denied { background: var(--surface-2); border-style: dashed; color: var(--muted); }
.cl-sh.denied > i:first-child { background: var(--neutral-bg); color: var(--muted); }
.cl-img { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; max-width: 320px; display: block; font: inherit; }
.cl-img img { display: block; max-width: 100%; max-height: 240px; border-radius: var(--radius-sm); }
.cl-zoom { max-width: 100%; display: block; margin: 0 auto; }

.cl-comp { align-items: flex-end; gap: 6px; background: var(--surface); }
.cl-tools { display: flex; gap: 2px; }
.cl-tools .icon-btn { cursor: pointer; }
.cl-in { flex: 1; position: relative; min-width: 0; }
.cl-in textarea { width: 100%; resize: none; min-height: 40px; max-height: 140px; line-height: 1.4; padding-top: 9px; }
.cl-send { width: 42px; padding: 0; flex: 0 0 auto; }
.cl-recbar { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px; border: 1px solid var(--bad); border-radius: var(--radius); background: var(--bad-bg); }
.cl-recbar [data-rect] { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--bad); }
.cl-mention { position: absolute; left: 0; bottom: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-2); min-width: 220px; max-width: 100%; z-index: 20; padding: 4px; }
.cl-mention button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 6px 8px; border-radius: var(--radius-sm); font: inherit; font-size: .86rem; cursor: pointer; text-align: left; color: var(--ink); }
.cl-mention button:hover, .cl-mention button:first-child { background: var(--brand-soft); }
.cl-mention .avatar { width: 24px; height: 24px; font-size: .62rem; }

.cl-thread-modal { display: flex; flex-direction: column; margin: -16px; }
.cl-thread-modal .cl-tbody { max-height: 52vh; min-height: 200px; overflow-y: auto; display: flex; flex-direction: column; }
.cl-thread-modal .thread-f { border-top: 1px solid var(--line); }
.cl-pick { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow-y: auto; }
.cl-pick button { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 9px 12px; font: inherit; font-size: .88rem; cursor: pointer; text-align: left; color: var(--ink); min-width: 0; }
.cl-pick button:hover { border-color: var(--brand); background: var(--brand-soft); }
.cl-pick button > i { color: var(--brand); }
.cl-share-sum { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

@media (max-width: 860px) {
  .cl-chat .inbox { height: auto; min-height: 0; }
  .cl-chat .thread-b { min-height: 52vh; max-height: calc(100vh - var(--top-h) - var(--bottom-h) - 250px); }
  .cl-hide-sm { display: none; }
  .cl-audio { width: 220px; }
  .cl-file, .cl-call, .cl-sh { max-width: 100%; }
}
@media (max-width: 420px) {
  .cl-msg { grid-template-columns: 28px minmax(0, 1fr) auto; gap: 0 8px; }
  .cl-mav { width: 28px; height: 28px; font-size: .64rem; }
  .cl-body { padding: 10px; }
  .cl-tools .icon-btn { width: 32px; }
}
