/* Mail Assistant — thème clair, sidebar sombre (cf. maquette) */
:root {
  --navy: #0f1b3d;
  --navy-2: #16234d;
  --bg: #f3f5f9;
  --card: #ffffff;
  --border: #e4e8f0;
  --text: #1a2235;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff4ff;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #ea8a0c;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.error { color: var(--red); margin-top: 10px; }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--navy) 0%, #1e3a8a 100%);
}
.login-card {
  background: var(--card); border-radius: 16px; padding: 40px 44px;
  width: 360px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.login-logo { font-size: 44px; margin-bottom: 8px; }
.login-card h1 { font-size: 22px; margin-bottom: 4px; }
.login-card form { margin-top: 24px; display: flex; flex-direction: column; gap: 12px; }
.login-card input {
  padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
}
.login-card input:focus { outline: 2px solid var(--accent); border-color: transparent; }

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0; background: var(--navy); color: #cfd6e6;
  display: flex; flex-direction: column; padding: 14px 12px; gap: 10px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 4px 8px; }
.brand-icon {
  width: 38px; height: 38px; background: var(--accent); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
.brand-name { color: #fff; font-weight: 600; font-size: 15px; }
.brand-sub { font-size: 11px; opacity: .7; }
.side-title {
  font-size: 10.5px; letter-spacing: .8px; opacity: .55; margin: 4px 8px 3px;
  display: flex; align-items: center; gap: 6px;
}
.side-link {
  display: flex; align-items: center; gap: 8px; padding: 4px 10px; border-radius: 8px;
  color: #cfd6e6; text-decoration: none; font-size: 13px; cursor: pointer;
}
.side-link:hover { background: var(--navy-2); color: #fff; }
.side-link.active { background: var(--accent); color: #fff; }
.side-link.disabled { opacity: .4; cursor: default; }
.side-link.disabled:hover { background: none; color: #cfd6e6; }
.side-link .badge { margin-left: auto; }
.soon-badge {
  background: rgba(255,255,255,.12); border-radius: 20px; padding: 1px 8px;
  font-size: 9.5px; letter-spacing: 0; text-transform: none;
}
.side-footer { margin-top: auto; padding: 8px; }
.version-line { font-size: 10.5px; opacity: .5; text-align: center; margin-bottom: 8px; }
.account-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-dot {
  width: 10px; height: 10px; border-radius: 50%; display: inline-block;
  flex-shrink: 0; box-shadow: 0 0 0 2px rgba(255,255,255,.15);
}
.acct-chip { font-weight: 600; }

/* ---------- Main ---------- */
.main { flex: 1; padding: 26px 32px; max-width: 1400px; }
.page-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 10px; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.head-actions { display: flex; gap: 10px; }

/* Cartes / grilles */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.kpi .kpi-label { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 12.5px; }
.kpi .kpi-value { font-size: 26px; font-weight: 700; margin-top: 6px; }
.kpi .kpi-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.accent .kpi-value { color: var(--accent); }
.kpi.green .kpi-value { color: var(--green); }
.kpi.orange .kpi-value { color: var(--orange); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); margin-bottom: 16px;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 12px 18px 16px; }
.panel-body.tight { padding: 0; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 12px;
  padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap;
  cursor: pointer; user-select: none;
}
th.sorted { color: var(--accent); }
td { padding: 9px 12px; border-bottom: 1px solid #f0f2f7; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafbfe; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Badges & bars */
.badge {
  display: inline-block; border-radius: 20px; padding: 2px 9px; font-size: 11px; font-weight: 600;
}
.badge.blue { background: var(--accent-soft); color: var(--accent); }
.badge.green { background: #e8f7ee; color: var(--green); }
.badge.red { background: #fdecec; color: var(--red); }
.badge.orange { background: #fdf3e2; color: var(--orange); }
.badge.gray { background: #eef0f4; color: var(--muted); }
.bar-track { background: #edf0f5; border-radius: 6px; height: 8px; min-width: 120px; }
.bar-fill { height: 8px; border-radius: 6px; background: var(--accent); }

/* Boutons & champs */
.btn {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 8px; padding: 8px 14px; font-size: 13px; cursor: pointer; font-weight: 500;
}
.btn:hover { border-color: #c9d1e0; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #1d4fd8; }
.btn-green { background: var(--green); border-color: var(--green); color: #fff; }
.btn-ghost { background: transparent; border-color: rgba(255,255,255,.25); color: #cfd6e6; width: 100%; }
.btn-ghost:hover { background: var(--navy-2); color: #fff; }
.btn-block { width: 100%; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
select, input[type="date"], input[type="number"], input[type="text"], input[type="search"] {
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 10px; font-size: 13px;
  background: var(--card); color: var(--text);
}

/* Progress / notices */
.notice {
  background: var(--accent-soft); border: 1px solid #d7e4ff; color: #1e429f;
  border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13.5px;
}
.notice.warn { background: #fdf5e6; border-color: #f5e0b8; color: #92600a; }
.sync-log {
  background: #0f1b3d; color: #b9c5e0; font-family: ui-monospace, Consolas, monospace;
  font-size: 12px; border-radius: 8px; padding: 10px 14px; max-height: 180px;
  overflow-y: auto; white-space: pre-wrap; margin-top: 10px;
}
.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid #cbd5f0;
  border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite;
  vertical-align: -2px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Barre de chargement globale : au-dessus de TOUT (reader z96, modales z100). */
.top-loader {
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 200;
  pointer-events: none; overflow: hidden; opacity: 0; transition: opacity .2s ease;
}
.top-loader.is-loading { opacity: 1; }
.top-loader::before {
  content: ""; position: absolute; top: 0; height: 100%; width: 40%; left: -40%;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  animation: top-loader-slide 1.05s ease-in-out infinite;
}
@keyframes top-loader-slide {
  0%   { left: -45%; width: 45%; }
  50%  { width: 60%; }
  100% { left: 100%; width: 45%; }
}
@media (prefers-reduced-motion: reduce) {
  .top-loader::before { animation: none; left: 0; width: 100%; background: var(--accent); opacity: .6; }
}

.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.placeholder-card { opacity: .65; }
.op-line { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f2f7; font-size: 13px; align-items: baseline; }
.op-line:last-child { border-bottom: none; }
.op-time { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* ---------- Réponses en attente ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--border); background: var(--card); color: var(--text);
  border-radius: 20px; padding: 7px 14px; font-size: 13px; cursor: pointer; font-weight: 500;
  display: flex; align-items: center; gap: 7px;
}
.tab:hover { border-color: #c9d1e0; }
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab.active .badge { background: rgba(255,255,255,.2); color: #fff; }
.reply-row {
  display: flex; gap: 16px; padding: 13px 18px; border-bottom: 1px solid #f0f2f7;
  align-items: flex-start;
}
.reply-row:last-child { border-bottom: none; }
.reply-row:hover { background: #fafbfe; }
.reply-main { flex: 1; min-width: 0; }
.reply-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.reply-subject { margin-top: 3px; font-size: 13.5px; }
.reply-reason { margin-top: 4px; font-size: 12px; }
.reply-side {
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  flex-shrink: 0; max-width: 250px; text-align: right;
}
.reply-date { color: var(--muted); font-size: 12px; }
.reply-actions { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; justify-content: flex-end; }
.reply-actions select { padding: 5px 8px; font-size: 12px; }

/* ---------- Mails importants ---------- */
.score-pill {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14.5px; color: #fff; margin-top: 2px;
}
.score-pill.high { background: var(--red, #d64545); }
.score-pill.medium { background: var(--orange, #d98324); }
.score-pill.low { background: #9aa4b8; }
.op-line .score-pill { width: 30px; height: 30px; font-size: 12px; margin-top: 0; align-self: center; }

/* ---------- Boîte de réception navigable (L5.2) ---------- */
.unread-row td { background: #fbfcff; }
.unread-subject { font-weight: 700; }
.inbox-pager {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  margin: 2px 4px 10px; font-size: 12.5px;
}

/* ---------- Sujets cliquables → panneau de lecture ---------- */
.openable { cursor: pointer; }
.openable:hover { color: var(--accent); text-decoration: underline; }

/* ---------- Brief du jour (L5) ---------- */
.brief-when { font-weight: 400; font-size: 12px; margin-left: 6px; }
#brief-caret { display: inline-block; width: 14px; color: var(--muted); }
.brief-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.brief-chip {
  display: inline-flex; gap: 6px; align-items: baseline;
  background: var(--bg); border: 1px solid var(--border); border-radius: 20px;
  padding: 5px 12px; font-size: 12.5px; color: var(--text); text-decoration: none;
}
.brief-chip[href]:hover { border-color: var(--accent); color: var(--accent); }
.brief-chip.hot { background: #fdf3e2; border-color: #f5e0b8; }
.brief-section { margin-bottom: 10px; }
.brief-section h3 { font-size: 12.5px; color: var(--muted); margin: 4px 0 2px; font-weight: 600; }
.brief-account { white-space: nowrap; }

/* ---------- Barre d'export contacts ---------- */
.export-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--accent-soft); border-bottom: 1px solid #d7e4ff;
  padding: 10px 14px; font-size: 13px;
}

/* ---------- Composer un mail (L5.3) ---------- */
.compose-grid {
  display: grid; grid-template-columns: 52px 1fr; gap: 8px 10px; align-items: center;
}
.compose-grid label { color: var(--muted); font-size: 12.5px; text-align: right; }
.compose-grid input { width: 100%; }

/* ---------- Modale ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 27, 61, .55); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--card); border-radius: 14px; width: 560px; max-width: 100%;
  max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(0,0,0,.35);
}
/* Modale « liste de mails » : large pour lire chaque ligne d'un coup. */
.modal.modal-wide { width: 1100px; }
/* La modale passe SOUS le panneau de lecture (z 95/96) : on peut ouvrir
   un mail depuis la liste sans la fermer. */
.modal-overlay.under-reader { z-index: 94; }
/* Table dense pour les longues listes en modale. */
.table-compact th { padding: 6px 10px; }
.table-compact td { padding: 4px 10px; font-size: 12.5px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { font-size: 16px; }
.modal-close { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border);
}
.preview-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0;
}
.preview-item { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.preview-item .lbl { font-size: 11.5px; color: var(--muted); }
.preview-item .val { font-size: 16px; font-weight: 700; margin-top: 2px; }
.subject-list {
  margin-top: 10px; border: 1px solid var(--border); border-radius: 8px;
  max-height: 150px; overflow-y: auto; font-size: 12.5px;
}
.subject-list div { padding: 6px 10px; border-bottom: 1px solid #f0f2f7; }
.subject-list div:last-child { border-bottom: none; }
.trash-note {
  background: #fdf5e6; border: 1px solid #f5e0b8; color: #92600a;
  border-radius: 8px; padding: 10px 14px; font-size: 12.5px; margin-top: 12px;
}
.cat-toggle { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.cat-toggle label {
  display: flex; gap: 8px; align-items: baseline; font-size: 13px;
  background: var(--bg); border-radius: 8px; padding: 9px 12px; cursor: pointer;
}
.mail-list {
  margin-top: 10px; border: 1px solid var(--border); border-radius: 8px;
  max-height: 280px; overflow-y: auto;
}
.mail-row {
  display: flex; gap: 8px; align-items: center; padding: 6px 10px;
  border-bottom: 1px solid #f0f2f7; font-size: 12.5px; cursor: pointer;
}
.mail-row:last-child { border-bottom: none; }
.mail-row:hover { background: #fafbfe; }
.mail-row.personal { background: #fffdf5; }
.mail-date { color: var(--muted); font-size: 11.5px; white-space: nowrap; min-width: 82px; }
.mail-subject { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-details summary {
  cursor: pointer; color: var(--accent); font-size: 12px; margin-top: 4px;
  user-select: none;
}
.op-items {
  margin: 6px 0 4px; border: 1px solid var(--border); border-radius: 8px;
  max-height: 220px; overflow-y: auto; font-size: 12.5px; padding: 4px 10px;
}
.op-items div { padding: 3px 0; border-bottom: 1px solid #f0f2f7; }
.op-items div:last-child { border-bottom: none; }

/* ---------- Indicateur global d'activité ---------- */
.activity-chip {
  position: fixed; bottom: 18px; right: 18px; z-index: 90;
  background: var(--navy); color: #dbe3f5; border-radius: 12px;
  padding: 10px 16px; font-size: 12.5px; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: 5px; max-width: 340px;
}
.activity-chip .chip-line { display: flex; gap: 8px; align-items: center; cursor: pointer; }
.activity-chip .chip-line:hover { color: #fff; }
.activity-chip .spinner { border-color: rgba(255,255,255,.3); border-top-color: #7ea6ff; margin: 0; }
.sync-badge { margin-left: auto; }

/* ---------- Recherche & lecture (L3) ---------- */
.search-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px;
}
.search-bar input[type="search"] { flex: 1; min-width: 240px; padding: 10px 14px; font-size: 14px; }
.search-filters {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px; font-size: 12.5px;
}
.search-filters label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.result-group-head {
  display: flex; gap: 8px; align-items: baseline; padding: 11px 18px;
  border-bottom: 1px solid var(--border); background: #fafbfe;
  font-weight: 600; font-size: 13px;
}
.result-row {
  display: flex; gap: 10px; align-items: baseline; padding: 9px 18px;
  border-bottom: 1px solid #f0f2f7; font-size: 13px; cursor: pointer;
}
.result-row:last-child { border-bottom: none; }
.result-row:hover { background: #f4f7ff; }
.result-row.unread .result-subject { font-weight: 700; }
.result-row.selected { background: var(--accent-soft); }
.result-from { width: 200px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-subject { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Panneau latéral de lecture */
.reader-overlay { position: fixed; inset: 0; background: rgba(15, 27, 61, .25); z-index: 95; }
.reader {
  position: fixed; top: 0; right: 0; bottom: 0; width: 620px; max-width: 92vw; z-index: 96;
  background: var(--card); box-shadow: -18px 0 50px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
}
.reader-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.reader-head h2 { font-size: 16px; line-height: 1.35; word-break: break-word; }
.reader-meta { padding: 12px 20px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.reader-meta div { margin: 2px 0; word-break: break-word; }
.reader-analysis {
  padding: 10px 20px; border-bottom: 1px solid var(--border);
  background: #f8faff; font-size: 12.5px;
}
.reader-analysis .ra-title { font-weight: 600; margin-bottom: 6px; }
.reader-analysis .ra-line {
  display: flex; gap: 8px; align-items: center; padding: 3px 0; flex-wrap: wrap;
}
.reader-analysis .score-pill { width: 28px; height: 28px; font-size: 11.5px; }
.reader-analysis .ra-deadline { display: inline-flex; gap: 6px; align-items: center; }
.reader-body {
  flex: 1; overflow-y: auto; padding: 16px 20px; font-size: 13.5px;
  white-space: pre-wrap; word-break: break-word; line-height: 1.55;
}
.reader-attachments { padding: 10px 20px; border-top: 1px solid var(--border); font-size: 12.5px; }
.reader-attachments .att-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap;
}
.att-toggle {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 12px; padding: 2px 4px; line-height: 1; border-radius: 4px;
}
.att-toggle:hover { background: var(--bg); color: var(--accent); }
.att-toggle-spacer { width: 4px; }
.reader-attachments .att-total { font-size: 11.5px; }
.att-zip-btn { margin-left: auto; white-space: nowrap; }

/* Puces horizontales compactes façon Outlook, qui s'enroulent. */
.att-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.att-chips.collapsed { display: none; }
.att-chip {
  display: flex; align-items: center; gap: 6px; max-width: 260px;
  padding: 5px 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; font-size: 12px;
}
.att-chip .att-ico { flex: none; }
.att-chip .att-name {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500;
}
.att-chip .att-size { flex: none; color: var(--muted); font-size: 11px; }
.att-chip .att-act {
  flex: none; background: none; border: none; cursor: pointer; padding: 2px 3px;
  border-radius: 4px; font-size: 13px; line-height: 1;
}
.att-chip .att-act:hover { background: var(--card); }
.att-chip .att-act:disabled { opacity: .7; cursor: default; }
.reader-actions {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 20px; border-top: 1px solid var(--border); background: #fafbfe;
}
.reader-actions select { padding: 6px 8px; font-size: 12px; max-width: 190px; }

/* ---------- Enrôlement (device code) ---------- */
.device-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 20px; margin-top: 14px; text-align: center;
}
.device-box .lbl { font-size: 12.5px; color: var(--muted); }
.device-link { font-size: 15px; font-weight: 600; color: var(--accent); word-break: break-all; }
.device-code {
  font-family: ui-monospace, Consolas, monospace; font-size: 30px; font-weight: 700;
  letter-spacing: 5px; background: #fff; border: 2px dashed var(--accent);
  border-radius: 10px; padding: 12px 16px; margin-top: 6px; display: inline-block;
  user-select: all;
}

/* ---------- Calendrier des échéances (L5.7) ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 980px) { .cal-layout { grid-template-columns: 1fr; } }
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cal-title { font-size: 17px; font-weight: 700; text-transform: capitalize; min-width: 160px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; padding: 4px 0; letter-spacing: .04em; }
.cal-cell {
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  min-height: 84px; padding: 5px 6px; cursor: pointer; overflow: hidden;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.out { opacity: .38; }
.cal-cell.weekend { background: #f4f6fa; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.selected { background: var(--accent-soft); border-color: var(--accent); }
.cal-daynum { font-size: 12px; font-weight: 600; }
.cal-cell.today .cal-daynum { color: var(--accent); }
.cal-ev {
  font-size: 11px; line-height: 1.3; border-left: 3px solid var(--accent);
  border-radius: 4px; padding: 1px 5px; background: #f1f4fa;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0;
}
.cal-ev.proposed { border-left-style: dashed; opacity: .8; }
.cal-more { font-size: 11px; }
.cal-side-row { padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.cal-side-row:last-child { border-bottom: none; }

/* ---------- Paramètres (L5.8) ---------- */
.set-line { display: flex; justify-content: space-between; gap: 16px; padding: 7px 0; border-bottom: 1px solid #f0f2f7; font-size: 13.5px; }
.set-line:last-child { border-bottom: none; }
input[type="color"].set-color {
  width: 34px; height: 26px; padding: 1px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card); cursor: pointer; vertical-align: middle;
}
.set-color-reset { margin-left: 4px; }

/* ---------- Aide (L5.10) ---------- */
.help-body { display: flex; flex-direction: column; gap: 2px; }
.help-qa summary {
  cursor: pointer; font-weight: 600; font-size: 13.5px; padding: 8px 4px;
  border-radius: 6px; list-style-position: inside;
}
.help-qa summary:hover { background: var(--accent-soft); }
.help-qa > div { padding: 4px 8px 12px 22px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.help-qa code { background: #eef0f4; border-radius: 4px; padding: 1px 5px; font-size: 12px; }
.help-list { padding-left: 20px; font-size: 13px; line-height: 1.7; color: var(--muted); }

/* Bouton retour en haut (L5.10) */
.scroll-top {
  position: fixed; bottom: 22px; right: 22px; z-index: 40;
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--card); color: var(--accent); font-size: 18px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 24, 40, .18);
}
.scroll-top:hover { background: var(--accent-soft); }
th.sortable:hover { color: var(--accent); }

/* Sous-liens de dossiers dans la sidebar (L5.12) */
.side-sub { padding-left: 28px; font-size: 12.5px; }

/* Étoile de suivi (L5.13) */
.star { cursor: pointer; font-size: 15px; vertical-align: middle; user-select: none; }
.star:hover { transform: scale(1.2); display: inline-block; }

/* Actions rapides du dashboard (L5.16) */
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-actions .btn { text-decoration: none; }

/* Arborescence des boîtes dans la sidebar (L5.17) */
.side-acct .side-link { padding: 4px 8px; gap: 6px; }
.side-acct-link {
  display: flex; align-items: center; gap: 8px; color: inherit;
  text-decoration: none; flex: 1; min-width: 0;
}
.side-caret {
  width: 18px; height: 18px; flex-shrink: 0; border-radius: 5px;
  border: 1px solid rgba(255,255,255,.25); background: transparent; color: #cfd6e6;
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
}
.side-caret:hover { background: var(--navy-2); color: #fff; border-color: rgba(255,255,255,.5); }
.side-folders { margin: 0 0 4px 20px; border-left: 1px solid rgba(255,255,255,.12); }
.side-folder {
  display: flex; align-items: center; gap: 6px; padding: 3px 8px 3px 10px;
  color: #aab4cc; font-size: 12.5px; cursor: pointer; border-radius: 0 8px 8px 0;
  text-decoration: none;
}
.side-folder:hover { background: var(--navy-2); color: #fff; }
.side-folder .badge { margin-left: auto; }
.side-folder-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-folder.muted { cursor: default; font-size: 11.5px; }
.side-folder.muted:hover { background: none; color: #aab4cc; }

/* Surlignage contextuel de l'arborescence (L5.18) */
.side-folder.active { background: var(--accent); color: #fff; }
.side-hint { font-size: 9.5px; opacity: .8; text-transform: none; letter-spacing: 0; }

/* Quota des boîtes (L5.18) */
.quota-cell { display: flex; flex-direction: column; gap: 3px; min-width: 150px; }
