/* ==========================================================================
   Groupe VS — styles propres aux pages (hors Univers), écrits avec les jetons de vs.css.
   Style « Apple » (v20). Couleurs : uniquement des rôles (--surface, --text, --accent…). Exceptions : couleurs
   d'événements/armoires venues de --c en ligne, pastilles d'aperçu de fond, --danger-solid.
   ========================================================================== */

[hidden] { display: none !important; }

/* Carte de verre pour les blocs propres aux pages */
.pc, .search-form, .dossier, .ged-side .panel, .comment-list li {
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-lg); box-shadow: var(--shadow); color: var(--text);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}

/* ---------- Petits éléments partagés ---------- */
.legend { font-size: var(--t-sm); font-weight: 600; color: var(--text-muted); }
fieldset { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.section { display: flex; flex-direction: column; gap: var(--s4); }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s6); }
.two > .field + .field, .two > * + .field { margin-top: 0; }
.guide { white-space: pre-line; margin: var(--s2) 0 0; color: var(--text); }
.search { width: 340px; max-width: 100%; }
.main > header:not(.head) { display: flex; flex-direction: column; gap: var(--s1); }
.main > header:not(.head) p { color: var(--text-muted); }
.badge { white-space: nowrap; padding: 2px var(--s2); border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font-size: var(--t-sm); font-weight: 600; }
.pill { margin: 2px 4px 2px 0; }
.pill.off { color: var(--danger); background: var(--danger-soft); }
.pill.ghost { background: var(--fill-2); color: var(--text); text-decoration: none; }
.pill.ghost:hover { background: var(--fill); }
a.pill { text-decoration: none; }
.dot { width: 12px; height: 12px; border-radius: 4px; background: var(--c, var(--accent)); display: inline-block; flex-shrink: 0; }
.avatar { flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; background: var(--c, var(--accent)); color: #fff; font-weight: 700; font-size: var(--t-base); display: inline-flex; align-items: center; justify-content: center; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.avatar.group { background: var(--fill); color: var(--text); font-size: var(--t-xl); text-shadow: none; }
.logo-inline { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.logo-inline.big { width: 44px; height: 44px; }
.ag-tools { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.nav-links a.nav-sub .nav-count { margin-left: auto; }

/* ---------- Connexion ---------- */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: var(--s5); background: var(--bg-grouped); }
.login-card { width: 400px; max-width: 100%; padding: var(--s8); border-radius: var(--r-xl); background: var(--surface); color: var(--text); border: 1px solid var(--card-line); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; gap: var(--s5); text-align: center; align-items: center; }
.login-card .brand { padding: 0; align-items: center; text-align: center; color: var(--text-muted); gap: var(--s2); }
.login-logo { width: 160px; max-width: 60%; height: auto; margin: 0 auto var(--s2); }
.login-title { font-size: var(--t-3xl); line-height: 34px; }
.login-card .btn { height: 44px; padding: 0 var(--s6); border-radius: var(--r-pill); }
.login-card .notice { text-align: left; width: 100%; }

/* ---------- Administration ---------- */
.admin-cols { display: flex; gap: var(--s6); align-items: flex-start; }
.admin-cols > .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--s6); }
.admin-cols > .panel { width: 340px; flex-shrink: 0; }
.toggle { width: 36px; height: 36px; padding: 0; border-radius: var(--r-md); border: 1px solid var(--border-strong); background: var(--field); display: inline-flex; align-items: center; justify-content: center; transition: background var(--d-fast) var(--ease-in), border-color var(--d-fast) var(--ease-in); }
.toggle:hover { border-color: var(--text-muted); }
.toggle.on { background: var(--accent); border-color: var(--accent); }
.toggle.on svg { stroke: var(--accent-fg); }
.actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--s2); white-space: nowrap; }
.table th.c, .table td.c { padding-left: var(--s2); padding-right: var(--s2); }
.table .cat-row td { font-size: var(--t-lg); padding: var(--s2) var(--s4); }
.preview-current { width: 240px; max-width: 100%; border: 1px solid var(--border); border-radius: var(--r-sm); display: block; }
.confirm .pop form { display: flex; flex-direction: column; gap: var(--s2); }

/* ---------- Applications : tuiles, aperçus, PC ---------- */
.home-main { min-width: 0; display: flex; flex-direction: column; gap: var(--s6); }
.rubrique { display: flex; flex-direction: column; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s4); }
.tile { display: flex; flex-direction: column; gap: var(--s3); min-height: 132px; padding: var(--s4); text-decoration: none; color: var(--text); transition: box-shadow var(--d-med) var(--ease-in), transform var(--d-med) var(--ease-in); }
.tile:hover { color: var(--text); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.tile-top { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s2); }
.mono { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--fill); color: var(--text); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: var(--t-lg); flex-shrink: 0; }
.tile-name { font-size: var(--t-lg); font-weight: 600; }
.tile-desc { font-size: var(--t-md); line-height: 18px; color: var(--text-muted); }
.tile.has-preview { padding: 0; overflow: hidden; gap: 0; }
.tile-shot { position: relative; aspect-ratio: 16 / 10; background: var(--fill-2); border-bottom: 1px solid var(--border); }
.tile-shot img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.tile-shot .badge { position: absolute; top: var(--s2); right: var(--s2); background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow); }
.tile.has-preview .tile-text { padding: var(--s3) var(--s4) var(--s4); }
.tile-text.with-logo { display: flex; gap: var(--s3); align-items: center; }
.logo-on-image { position: absolute; left: 10px; bottom: 10px; width: 48px; height: 48px; padding: 6px; background: #fff; border-radius: var(--r-sm); box-shadow: 0 2px 8px rgba(0, 0, 0, .25); display: flex; align-items: center; justify-content: center; }
.logo-on-image img { width: 100%; height: 100%; object-fit: contain; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: var(--s4); }
.pc { padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.pc-row { display: flex; align-items: center; gap: var(--s4); }
.pc-row > div { flex-grow: 1; }
.pc summary { cursor: pointer; color: var(--accent-text); font-weight: 600; min-height: 32px; display: flex; align-items: center; }

/* ---------- Tableau de bord ---------- */
.main.dash { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: var(--s6); align-items: start; }
.dash-main { min-width: 0; display: flex; flex-direction: column; gap: var(--s5); }
.dash-side { position: sticky; top: 72px; display: flex; flex-direction: column; gap: var(--s4); }
.dash-side .today-card { gap: var(--s3); }
.inbox-count { margin: 0; font-size: var(--t-base); font-weight: 600; color: var(--accent-text); }
.inbox-count.late { color: var(--danger); }
.inbox-list { list-style: none; margin: 0 calc(-1 * var(--s2)); padding: 0; display: flex; flex-direction: column; }
.inbox-list li { border-top: 1px solid var(--border); margin-left: var(--s2); }
.inbox-list li:first-child { border-top: 0; }
.inbox-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--s2); min-height: 44px; padding: var(--s2) var(--s2) var(--s2) var(--s2); margin-left: calc(-1 * var(--s2)); text-decoration: none; color: var(--text); border-radius: var(--r-sm); }
.inbox-list a:hover { background: var(--surface-hover); color: var(--text); }
.inbox-list time { font-size: var(--t-md); color: var(--text-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.inbox-from { font-size: var(--t-base); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-subject { grid-column: 1 / -1; font-size: var(--t-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-preview { grid-column: 1 / -1; font-size: var(--t-md); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-list li.unread .inbox-from, .inbox-list li.unread .inbox-subject { font-weight: 600; color: var(--text); }
.inbox-list li.unread .inbox-from::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--accent); }

/* Liste de tâches (tableau de bord) : rangées de 48 px, filets insetés après la pastille, chevron */
.task-list { list-style: none; margin: 0 calc(-1 * var(--s2)); padding: 0; display: flex; flex-direction: column; }
.task-list li { position: relative; display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: var(--s2); }
.task-list li + li::before { content: ''; position: absolute; top: 0; left: 42px; right: 0; border-top: 1px solid var(--border); }
.task-list li::after { content: '›'; color: var(--text-muted); font-size: var(--t-xl); line-height: 1; opacity: .7; }
.task-list li form { display: contents; }
.task-list li a { display: flex; flex-direction: column; min-width: 0; flex: 1; text-decoration: none; color: var(--text); }
.task-list li a:hover .task-title { color: var(--accent-text); }
.task-list .task-title { font-size: var(--t-base); line-height: 20px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; }
.task-list li.p4 .task-title::before { content: '! '; color: var(--danger); font-weight: 700; }
.task-list .sub { font-size: var(--t-md); }
.quick-add { display: flex; gap: var(--s2); align-items: center; padding: var(--s3) var(--s4); }
.quick-add .input { flex-grow: 1; }
.quick-add.small { padding: 0; border: 0; background: none; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; margin-top: var(--s1); flex-wrap: nowrap; }
.quick-add.small .input { flex: 1 1 0; min-width: 0; width: auto; }
.quick-add.small .btn { width: 32px; height: 32px; padding: 0; font-size: var(--t-lg); }

/* ---------- Agenda ---------- */
.ag-cals { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s5); align-items: center; }
.ag-cals .check { gap: var(--s2); }
.ag-body { display: flex; gap: var(--s6); align-items: flex-start; }
.ag-view { flex: 1; min-width: 0; overflow: auto; }
.detail { width: 340px; flex-shrink: 0; position: sticky; top: 72px; }
.detail h2 { font-size: var(--t-2xl); font-weight: 700; line-height: 28px; }
.detail dl { margin: 0; display: flex; flex-direction: column; gap: var(--s1); }
.detail dt { margin-top: var(--s3); font-size: var(--t-sm); font-weight: 600; color: var(--text-muted); }
.detail dd { margin: 0; }
.detail-src { display: flex; align-items: center; gap: var(--s2); font-size: var(--t-md); color: var(--text-muted); }
.detail-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

.grid { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(110px, 1fr)); min-width: calc(64px + var(--cols) * 110px); }
.grid-corner, .grid-day, .grid-label, .grid-allday { border-bottom: 1px solid var(--border); }
.grid-day { padding: var(--s2); text-align: center; text-decoration: none; color: var(--text); display: flex; flex-direction: column; align-items: center; gap: 2px; border-left: 1px solid var(--border); }
.grid-day:hover { color: var(--text); background: var(--surface-hover); }
.grid-day span { font-size: var(--t-sm); color: var(--text-muted); font-weight: 600; }
.grid-day strong { font-family: var(--body); font-size: var(--t-lg); font-weight: 600; width: 36px; height: 36px; line-height: 36px; border-radius: 50%; }
.grid-day.today span { color: var(--accent-text); }
.grid-day.today strong { background: var(--accent); color: #1D1D1F; }
.grid-label { font-size: var(--t-sm); color: var(--text-muted); padding: var(--s2) var(--s2) var(--s2) 0; text-align: right; }
.grid-allday { border-left: 1px solid var(--border); padding: var(--s1); display: flex; flex-direction: column; gap: 3px; min-height: 32px; }
.grid-hours div { font-size: var(--t-sm); color: var(--text-muted); text-align: right; padding-right: var(--s2); transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.grid-hours div:first-child { transform: none; }
.grid-col { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(to bottom, var(--border) 1px, transparent 1px); }
.grid-col.today { background-color: var(--accent-soft); }
.slot { position: absolute; left: 0; right: 0; }
.slot:hover { background: var(--surface-hover); }
.ev, .chip { --ev: var(--c, var(--accent)); background: color-mix(in srgb, var(--ev) 15%, var(--surface-solid)); border-left: 3px solid var(--ev); color: var(--text); text-decoration: none; }
.ev { position: absolute; overflow: hidden; border-radius: 6px; padding: var(--s1) var(--s2); display: flex; flex-direction: column; font-size: var(--t-md); line-height: 1.25; }
.ev:hover, .chip:hover { color: var(--text); background: color-mix(in srgb, var(--ev) 26%, var(--surface-solid)); text-decoration: none; }
.ev.sel, .chip.sel { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 2; }
.ev-time { font-size: var(--t-sm); color: var(--text); font-variant-numeric: tabular-nums; }
.ev-title { font-weight: 600; }
.ev-loc { font-size: var(--t-sm); color: var(--text); }
.chip { display: block; padding: 2px var(--s2); border-radius: 6px; font-size: var(--t-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip b { font-weight: 600; font-variant-numeric: tabular-nums; }

.month { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)); min-width: 840px; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; border-radius: 0; }
.month-head { padding: var(--s3); font-size: var(--t-sm); font-weight: 600; color: var(--text-muted); text-align: center; border-bottom: 1px solid var(--border); }
.month-cell { min-height: 118px; padding: 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell.out { background: var(--surface-hover); }
.month-cell.out .month-num { color: var(--text-muted); }
.month-cell.today { background: var(--accent-soft); }
.month-num { align-self: flex-end; min-width: 30px; height: 30px; line-height: 30px; text-align: center; border-radius: 50%; text-decoration: none; color: var(--text); font-weight: 600; font-size: var(--t-base); }
.month-cell.today .month-num { background: var(--accent); color: #1D1D1F; }
.more { font-size: var(--t-sm); padding: 2px var(--s2); color: var(--text-muted); }

/* Agenda compact (tableau de bord) : 7 jours dans la largeur */
.ag-compact .grid { grid-template-columns: 52px repeat(var(--cols), minmax(70px, 1fr)); min-width: calc(52px + var(--cols) * 70px); }
.ag-compact .grid-day { padding: 6px; gap: 0; }
.ag-compact .grid-day span { font-size: var(--t-sm); }
.ag-compact .grid-day strong { font-size: var(--t-base); width: 28px; height: 28px; line-height: 28px; }
.ag-compact .grid-label { padding: var(--s1) var(--s2) var(--s1) 0; }
.ag-compact .grid-allday { min-height: 24px; padding: 2px 3px; }
.ag-compact .grid-hours div { font-size: var(--t-sm); transform: translateY(-6px); }
.ag-compact .ev { padding: 1px 6px; font-size: var(--t-sm); border-radius: 6px; flex-direction: row; flex-wrap: wrap; gap: 0 6px; align-items: baseline; }
.ag-compact .ev-time { display: none; }
.ag-compact .ev-loc { display: none; }

/* ---------- Tâches ---------- */
.task-group { display: flex; flex-direction: column; gap: var(--s2); }
.tasks-page .head { position: relative; z-index: 30; }
.tasks-page .tasks-search .input { width: 170px; }
.tk-valider { height: 28px; }
.ged-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s3); align-items: end; padding: var(--s4); }
.ged-filters .field + .field { margin-top: 0; }
.ged-filters > .btn { justify-self: start; }

/* Fiche d'une tâche */
.task-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--s6); align-items: start; }
.drawer .task-layout { grid-template-columns: 1fr; }
.task-main { display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.task-side { display: flex; flex-direction: column; gap: var(--s4); }
.task-side h2, .task-main h2 { font-size: var(--t-lg); display: flex; align-items: baseline; gap: var(--s2); }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.check-list li { display: flex; align-items: center; gap: var(--s3); }
.check-list li .label { flex-grow: 1; }
.check-list li.done .label { text-decoration: line-through; color: var(--text-muted); }
.comment-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.comment-list li { padding: var(--s3) var(--s4); box-shadow: none; border: 0; background: var(--fill-2); }
.comment-head { display: flex; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s1); }
.log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); font-size: var(--t-base); }
.log-list li { display: flex; flex-direction: column; gap: 2px; padding-bottom: var(--s2); border-bottom: 1px solid var(--border); }
.log-list li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ---------- GED et Mes fichiers ---------- */
.ged-alerts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.ged-alerts .pill { height: 28px; padding: 0 var(--s3); font-size: var(--t-md); }
.ged-quick { display: flex; gap: var(--s2); align-items: center; }
.ged-quick .input { width: 280px; }
.ged-doc { display: inline-flex; align-items: center; gap: var(--s3); color: var(--text); text-decoration: none; }
.ged-doc:hover { color: var(--accent-text); text-decoration: none; }
.ged-ico { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 var(--s1); font-weight: 600; border-radius: var(--r-sm); background: var(--fill); font-size: var(--t-md); flex-shrink: 0; }
.validate-box { background: linear-gradient(var(--warning-soft), var(--warning-soft)), var(--surface); }
.ged-doc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s6); align-items: start; }
.ged-preview { overflow: hidden; min-height: 520px; display: flex; flex-direction: column; }
.ged-preview iframe { width: 100%; flex-grow: 1; min-height: 640px; border: 0; background: #fff; }
.ged-preview .empty { padding: var(--s12) var(--s6); }
.ged-side { display: flex; flex-direction: column; gap: var(--s4); }
.ged-side .panel { width: 100%; padding: var(--s5); }
.ged-side .btn { white-space: normal; height: auto; min-height: 32px; padding: 6px var(--s4); line-height: 20px; text-align: center; }
.ged-side h2 { font-size: var(--t-lg); }
.detail-dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px var(--s3); margin: 0; font-size: var(--t-base); }
.detail-dl dt { color: var(--text-muted); font-size: var(--t-md); padding-top: 1px; }
.detail-dl dd { margin: 0; overflow-wrap: anywhere; }
.fx-tabs { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); align-self: flex-start; flex-wrap: wrap; }
.fx-tab { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s4); border-radius: 7px; color: var(--text); text-decoration: none; font-size: var(--t-md); font-weight: 500; transition: background var(--d-fast) var(--ease-in); }
.fx-tab:hover { color: var(--text); text-decoration: none; background: var(--surface-hover); }
.fx-tab.on { background: var(--seg-on); box-shadow: var(--seg-shadow); font-weight: 600; }
.fx-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); flex-wrap: wrap; }
.fx-path { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.fx-path { margin-right: auto; }
.fx-form { gap: var(--s2); flex-wrap: nowrap; }
.fx-form .input { width: 200px; }
.fx-form input[type=file] { width: auto; font-size: var(--t-sm); max-width: 260px; }
input[type=file]::file-selector-button { margin-right: var(--s3); height: 26px; padding: 0 var(--s3); border: 0; border-radius: 6px; background: var(--accent-soft); color: var(--accent-text); font: inherit; font-size: var(--t-md); font-weight: 600; cursor: pointer; }
.fx-preview { min-height: 0; }
.fx-preview iframe { min-height: 560px; }
.fx-preview-bar { display: flex; justify-content: space-between; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); font-weight: 600; }

/* Armoires et dossiers */
.armoires { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s5); }
.armoire { position: relative; display: flex; flex-direction: column; gap: 6px; padding: var(--s5) var(--s5) var(--s4); border-radius: var(--r-lg); text-decoration: none; color: #fff; overflow: hidden; min-height: 176px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 82%, #fff), color-mix(in srgb, var(--c) 78%, #000)); box-shadow: var(--shadow);
  transition: transform var(--d-med) var(--ease-in), box-shadow var(--d-med) var(--ease-in); }
.armoire::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .34)); pointer-events: none; }
.armoire > * { position: relative; }
.armoire:hover { transform: translateY(-2px); color: #fff; text-decoration: none; box-shadow: var(--shadow-pop); }
.armoire-top { display: flex; justify-content: space-between; align-items: flex-start; }
.armoire-icon { font-size: 28px; line-height: 1; }
.armoire-name { font-size: var(--t-xl); font-weight: 700; line-height: 25px; }
.armoire-desc { font-size: var(--t-base); line-height: 20px; min-height: 18px; }
.armoire-drawers { display: none; }
.armoire-meta { font-size: var(--t-md); margin-top: auto; padding-top: 6px; }
.armoire .badge { background: rgba(255, 255, 255, .92); color: #1D1D1F; }
.armoire.new { background: var(--fill-2); color: var(--text); border: 1.5px dashed var(--border-strong); box-shadow: none; }
.armoire.new::before { display: none; }
.armoire.new:hover { color: var(--text); border-color: var(--accent); box-shadow: none; }
.dossiers { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: var(--s4); }
.dossier { position: relative; display: flex; flex-direction: column; gap: var(--s1); padding: 28px var(--s4) var(--s3); border-radius: 6px var(--r-lg) var(--r-lg) var(--r-lg); text-decoration: none; color: var(--text);
  transition: transform var(--d-med) var(--ease-in), box-shadow var(--d-med) var(--ease-in); }
.dossier::before { content: ''; position: absolute; top: -1px; left: -1px; width: 46%; height: 16px; border-radius: 6px 10px 0 0; background: var(--c, var(--accent)); opacity: .9; }
.dossier:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); color: var(--text); text-decoration: none; }
.dossier-tab { font-size: var(--t-sm); color: var(--text-muted); }
.dossier-name { font-size: var(--t-lg); font-weight: 600; line-height: 22px; }
.dossier-meta { font-size: var(--t-md); color: var(--text-muted); }
.dossier.closed { opacity: .6; }
.search-form { display: flex; flex-direction: column; gap: var(--s3); padding: var(--s5); }
.search-main { display: flex; gap: var(--s2); }
.search-main .input.big { height: 44px; font-size: var(--t-lg); flex-grow: 1; }
.tag-cloud { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ---------- Messagerie ---------- */
.main.chat { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--s4); max-width: none; margin: 52px 0 0; padding: var(--s4) var(--s8) var(--s5); height: calc(100vh - 52px); overflow: hidden; animation: none; }
.chat-list, .chat-pane { min-height: 0; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.chat-pane { background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--r-lg); box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur); }
.chat-list-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s5) var(--s5) var(--s3); }
.chat-list-head h1 { font-size: var(--t-3xl); line-height: 34px; }
.chat-search { padding: 0 var(--s4) var(--s3); }
.chat-items { overflow-y: auto; flex-grow: 1; scrollbar-width: thin; }
.chat-item { position: relative; display: flex; gap: var(--s3); align-items: center; min-height: 64px; padding: var(--s3) var(--s4); text-decoration: none; color: var(--text); }
.chat-item + .chat-item::before { content: ''; position: absolute; top: 0; left: 72px; right: 0; border-top: 1px solid var(--border); }
.chat-item:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.chat-item.on { background: var(--accent-soft); }
.chat-item-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-item-top, .chat-item-bottom { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.chat-item-top strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { font-size: var(--t-md); color: var(--text-muted); flex-shrink: 0; }
.chat-excerpt { font-size: var(--t-base); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item.unread .chat-excerpt { color: var(--text); font-weight: 500; }
.chat-badge { flex-shrink: 0; min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--r-pill); background: var(--danger-solid); color: #fff; font-size: var(--t-sm); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.chat-empty { align-items: center; justify-content: center; text-align: center; padding: var(--s10); }
.chat-empty h2 { margin: var(--s3) 0 var(--s2); }
.chat-empty .btn { margin-top: var(--s4); }
.chat-pane .chat-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s5); background: none; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.chat-head-text { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.chat-head-text .sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-back { display: none; font-size: var(--t-2xl); text-decoration: none; padding: var(--s1) var(--s2); }
.chat-pane > .notice { margin: var(--s3) var(--s5) 0; }
.chat-scroll { flex-grow: 1; overflow-y: auto; padding: var(--s4) var(--s6) var(--s2); scrollbar-width: thin; }
.chat-messages { display: flex; flex-direction: column; gap: var(--s1); max-width: 900px; margin: 0 auto; }
.chat-none { text-align: center; padding: var(--s10) 0; }
.day-sep, .unread-sep { text-align: center; margin: var(--s3) 0 6px; }
.day-sep span, .unread-sep span { display: inline-block; padding: var(--s1) var(--s3); border-radius: var(--r-pill); font-size: var(--t-sm); font-weight: 600; }
.day-sep span { background: var(--fill-2); color: var(--text-muted); }
.unread-sep span { background: var(--danger-soft); color: var(--danger); }
.msg { display: flex; }
.msg.mine { justify-content: flex-end; }
.msg.info { justify-content: center; margin: 6px 0; }
.msg.info span { font-size: var(--t-md); color: var(--text-muted); background: var(--fill-2); padding: 3px var(--s3); border-radius: var(--r-pill); max-width: 90%; text-align: center; }
.bubble { max-width: min(72%, 560px); padding: var(--s2) var(--s3) 6px; border-radius: var(--r-xl) var(--r-xl) var(--r-xl) 6px; color: var(--text); font-size: var(--t-base); background: var(--bubble-other); }
.msg.mine .bubble { border-radius: var(--r-xl) var(--r-xl) 6px var(--r-xl); background: var(--accent-soft); }
body.fond-anime .bubble { background: var(--surface-2); }
body.fond-anime .msg.mine .bubble { background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface-solid); }
.msg-author { font-size: var(--t-md); font-weight: 600; color: var(--text-muted); margin-bottom: 2px; }
.msg-text { overflow-wrap: anywhere; white-space: pre-wrap; }
.msg-text a { word-break: break-all; }
.msg-deleted { font-style: italic; color: var(--text-muted); font-size: var(--t-base); }
.msg-photo { display: block; margin: 2px -6px 6px; }
.msg-photo img { display: block; width: auto; height: auto; max-width: 100%; max-height: 360px; border-radius: var(--r-sm); object-fit: cover; }
.msg-meta { display: flex; justify-content: flex-end; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--text-muted); margin-top: 2px; }
.msg-del { background: none; border: 0; color: var(--text-muted); font-size: var(--t-sm); padding: 0 var(--s1); opacity: 0; cursor: pointer; min-height: 0; transition: opacity var(--d-fast) var(--ease-in); }
.msg:hover .msg-del, .msg-del:focus-visible { opacity: 1; }
.read-by { text-align: right; max-width: 900px; margin: var(--s1) auto 0; min-height: 16px; }
.chat-pane .chat-compose { padding: var(--s3) var(--s4) var(--s4); background: none; border: 0; border-top: 1px solid var(--border); border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.compose-row { display: flex; align-items: flex-end; gap: var(--s2); max-width: 900px; margin: 0 auto; }
.compose-row textarea { flex-grow: 1; resize: none; min-height: 40px; max-height: 160px; padding: 9px var(--s4); border: 1px solid var(--border-strong); border-radius: var(--r-xl); background: var(--field); color: var(--text); line-height: 1.4; }
.compose-row textarea::placeholder { color: var(--text-muted); }
.compose-row textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.compose-photo { width: 40px; height: 40px; border-radius: 50%; background: var(--fill); display: inline-flex; align-items: center; justify-content: center; font-size: var(--t-lg); cursor: pointer; flex-shrink: 0; }
.compose-photo:hover { background: var(--border-strong); }
.compose-photo input { display: none; }
.compose-send { width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: var(--t-lg); flex-shrink: 0; }
.photo-preview { position: relative; display: inline-block; margin: 0 0 var(--s2) 48px; }
.photo-preview img { max-height: 120px; max-width: 200px; border-radius: var(--r-sm); border: 1px solid var(--border); display: block; }
.photo-preview button { position: absolute; top: -8px; right: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--surface-solid); color: var(--text); border: 1px solid var(--border-strong); font-size: var(--t-xs); cursor: pointer; }
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px; }
.people.compact { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.person { padding: var(--s2) var(--s3); border: 1px solid var(--border-strong); border-radius: var(--r-sm); min-height: 44px; }
.person:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.person .avatar, .member-list .avatar { width: 36px; height: 36px; font-size: var(--t-sm); }
.member-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--s3); }
.member-list li { display: flex; align-items: center; gap: var(--s3); }

/* ---------- Mon apparence ---------- */
.profil { display: flex; flex-direction: column; gap: var(--s5); }
.profil h2 { font-size: var(--t-lg); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--s3); }
.choice { position: relative; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s2); border-radius: var(--r-lg); cursor: pointer; box-shadow: 0 0 0 1px var(--border-strong); background: var(--surface); transition: box-shadow var(--d-med) var(--ease-in); }
.choice:hover { box-shadow: 0 0 0 1px var(--text-muted); }
.choice input { position: absolute; opacity: 0; }
.choice:has(input:checked) { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-ring); }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-ring); }
.choice-img { height: 92px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); background: #1C1C1E; padding: var(--s3); } /* les logos « clair » se lisent sur fond sombre */
.choice-img img { max-width: 100%; max-height: 72px; }
.choice-label { font-size: var(--t-base); font-weight: 600; padding: 0 var(--s1) var(--s1); }
.theme-choice { padding: var(--s2) var(--s2) var(--s3); }
.theme-prev { display: flex; height: 96px; border-radius: var(--r-sm); overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.tp-half { position: relative; flex: 1; display: block; background: #F5F5F7; }
.tp-half.tp-d { background: #000; }
.tp-side { position: absolute; left: 0; top: 0; bottom: 0; width: 26%; background: rgba(246, 246, 248, .9); border-right: 1px solid rgba(0, 0, 0, .1); }
.tp-d .tp-side { background: #1C1C1E; border-color: rgba(255, 255, 255, .15); }
.tp-line { position: absolute; left: 34%; top: 14px; width: 40%; height: 7px; border-radius: 4px; background: #1D1D1F; }
.tp-line.s { top: 28px; width: 28%; background: #86868B; }
.tp-d .tp-line { background: #F5F5F7; } .tp-d .tp-line.s { background: #8E8E93; }
.tp-card { position: absolute; left: 34%; right: 8px; bottom: 10px; height: 26px; border-radius: 6px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.tp-d .tp-card { background: #1C1C1E; box-shadow: none; border: 1px solid rgba(255, 255, 255, .15); }
.tp-clair .tp-d, .tp-sombre .tp-l { display: none; }
.tp-auto .tp-half .tp-side { width: 40%; } .tp-auto .tp-half .tp-line, .tp-auto .tp-half .tp-card { left: 52%; }
.fond-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.fond-grid.big { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.fond-choice { position: relative; height: 62px; border-radius: var(--r-sm); overflow: hidden; cursor: pointer; background: linear-gradient(135deg, var(--bg1), var(--bg2) 45%, var(--bg3) 80%, var(--bg4)); display: flex; align-items: flex-end; box-shadow: 0 0 0 1px var(--border); }
.fond-grid.big .fond-choice { height: 86px; }
.fond-choice.fond-neutre { background: linear-gradient(135deg, #F5F5F7 50%, #000 50%); }
.fond-choice.fond-photo { background: var(--photo, linear-gradient(135deg, #999, #ccc)) center / cover; }
.fond-choice input { position: absolute; opacity: 0; }
.fond-choice span { width: 100%; padding: var(--s1) var(--s2); font-size: var(--t-md); font-weight: 600; color: #fff; background: rgba(0, 0, 0, .55); }
.fond-choice:has(input:checked) { box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-ring); }
.fond-choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Téléphone et tablette ---------- */
@media (max-width: 1500px) {
  .admin-cols { flex-direction: column; }
  .admin-cols > .grow { width: 100%; }
  .admin-cols > .panel { width: 100%; max-width: 640px; }
}
@media (max-width: 1200px) {
  .main.dash { grid-template-columns: minmax(0, 1fr); }
  .dash-side { position: static; }
}
@media (max-width: 1100px) {
  .ag-body { flex-direction: column; }
  .detail { width: 100%; position: static; order: -1; }
  .task-layout, .ged-doc-layout { grid-template-columns: minmax(0, 1fr); }
  .ag-body { align-items: stretch; }
}
@media (max-width: 1000px) {
  .main.chat { grid-template-columns: minmax(0, 1fr); }
  .main.chat.has-conv .chat-list { display: none; }
  .main.chat:not(.has-conv) .chat-pane { display: none; }
  .chat-back { display: inline-block; }
}
@media (max-width: 900px) {
  .ged-quick { flex-wrap: wrap; width: 100%; } .ged-quick .input { width: auto; flex: 1 1 160px; }
  .head .seg, .head .ag-tools { width: 100%; }
  .head .seg a, .head .seg button { flex: 1; justify-content: center; text-align: center; padding: 0 var(--s2); white-space: normal; line-height: 16px; }
  .admin-cols, .two { display: flex; flex-direction: column; }
  .pc-grid { grid-template-columns: 1fr; }
  .main.chat { height: auto; margin-top: 52px; padding: var(--s3) var(--s3) var(--s4); }
  .chat-pane, .chat-list { height: 78vh; }
  .chat-scroll { padding: var(--s3) var(--s3) var(--s2); }
  .bubble { max-width: 85%; }
  .chat-pane .chat-head { padding: var(--s3); }
  .login-card { padding: var(--s6); }
}
@media (max-width: 700px) { .tasks-page .tiles { grid-template-columns: repeat(2, 1fr); } }
.ged-filters { grid-template-columns: minmax(180px, 320px) minmax(180px, 320px) auto; justify-content: start; }

/* Application de bureau : boîte « À classer » */
.ac-item h2 { overflow-wrap: anywhere; }

/* ---------- Cibles tactiles ≥ 44 px (téléphone) ---------- */
.task-check { position: relative; }
.task-check::after { content: ''; position: absolute; inset: -11px; }
@media (max-width: 900px) {
  .nav-links a.nav-sub { min-height: 44px; }
  .user-chip > summary { min-width: 44px; justify-content: center; }
  .quick-add.small .btn, .compose-send, .compose-photo { width: 44px; height: 44px; }
  .compose-row textarea { min-height: 44px; }
  .fx-tab, .seg a, .seg button { min-height: 44px; }
  .ged-side .btn { min-height: 44px; }
  .menu .pop a { min-height: 44px; }
  .chat-back { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .head a:not(.btn), .today-head a, .tile-recap a, .main > header:not(.head) a, .text-btn, .confirm > summary, .ged-doc, .pc summary { display: inline-flex; align-items: center; min-height: 44px; }
  .task-list li { min-height: 52px; }
  .quick-add:not(.small) { flex-wrap: wrap; } .quick-add:not(.small) .input { flex: 1 1 100%; width: 100% !important; } .quick-add:not(.small) > .btn { flex: 1; }
  .tasks-page .table td:nth-child(2) { min-width: 220px; }
  .task-list li a { min-height: 44px; justify-content: center; }
  .table td > a:not(.btn), .table td > .ged-doc { display: inline-flex; align-items: center; min-height: 44px; }
}
