:root {
  --green: #2f5d3a;
  --green-light: #e7efe6;
  --wheat: #f6f1e4;
  --ink: #1f2a22;
  --muted: #6b756d;
  --line: #dcd6c6;
  --red: #a63d2f;
  --amber: #a8641a;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--wheat);
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--green);
  color: #fff;
  padding: 14px 16px calc(14px) 16px;
  padding-top: max(14px, env(safe-area-inset-top));
}
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.login { margin-top: 24px; }
.login h1 { margin: 0; }

.container { max-width: 720px; margin: 0 auto; padding: 16px 16px 48px; }

h1 { font-size: 1.35rem; margin: 8px 0 12px; }
h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 24px 0 8px; }

.flash {
  background: var(--green-light); border: 1px solid #c4d6c2;
  padding: 12px 14px; border-radius: var(--radius); margin-bottom: 14px;
}
.flash.error { background: #f8e6e2; border-color: #e5bdb4; color: var(--red); }
.flash form { margin-top: 8px; }

/* Dépôt */
.upload-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--green); color: #fff;
  border-radius: var(--radius); padding: 22px 16px;
  font-weight: 600; font-size: 1.1rem; cursor: pointer;
  box-shadow: 0 2px 8px rgba(47, 93, 58, .25);
}
.upload-btn input { display: none; }
.upload-btn small { font-weight: 400; opacity: .85; font-size: .9rem; }
.upload-icon { font-size: 2rem; line-height: 1; }
.upload { display: flex; flex-direction: column; gap: 10px; }
.upload.busy { opacity: .6; pointer-events: none; }
.upload-btn.secondary { background: #fff; color: var(--green); border: 2px solid var(--green); box-shadow: none; padding: 14px 16px; }
.upload-btn.secondary .upload-icon { font-size: 1.4rem; }
/* « Prendre une photo » : uniquement sur écran tactile (smartphone, tablette) */
.camera-only { display: none; }
@media (pointer: coarse) { .camera-only { display: flex; } }

/* Échéances */
.deadlines { list-style: none; padding: 0; margin: 0; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.deadlines li + li { border-top: 1px solid var(--line); }
.deadlines a { display: flex; gap: 10px; align-items: baseline; padding: 12px 14px; text-decoration: none; }
.due-date { font-weight: 700; color: var(--amber); white-space: nowrap; }
.due-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.due-amount { color: var(--muted); white-space: nowrap; }

/* Recherche & filtres */
.search input {
  width: 100%; font-size: 1rem; padding: 12px 14px; margin-top: 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0; scrollbar-width: none; }
.chip {
  flex: none; text-decoration: none; padding: 7px 12px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); font-size: .9rem; white-space: nowrap;
}
.chip.active { background: var(--green); color: #fff; border-color: var(--green); }
.chip .count { opacity: .65; margin-left: 2px; }

/* Cartes */
.cards { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; gap: 12px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; text-decoration: none;
}
.thumb { width: 48px; height: 64px; object-fit: cover; object-position: top; border-radius: 6px; border: 1px solid var(--line); background: var(--green-light); flex: none; }
.card-body { flex: 1; min-width: 0; }
.card-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.card-meta.error { color: var(--red); }
.card-side { text-align: right; white-space: nowrap; }
.amount { font-weight: 700; }
.due { color: var(--amber); font-size: .85rem; }
.tag { background: var(--green-light); color: var(--green); padding: 1px 8px; border-radius: 999px; font-weight: 600; }
.status-error { border-color: #e5bdb4; }

.empty { text-align: center; color: var(--muted); padding: 32px 8px; }

.spinner {
  display: inline-block; width: 12px; height: 12px; vertical-align: -1px;
  border: 2px solid var(--line); border-top-color: var(--green); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Fiche document */
.back { display: inline-block; text-decoration: none; color: var(--muted); margin-bottom: 4px; }
.preview { margin: 12px 0; }
.preview img { width: 100%; max-height: 60vh; object-fit: contain; background: #fff; border-radius: var(--radius); border: 1px solid var(--line); }
.pdf-link { display: block; text-align: center; padding: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 600; }
.summary { background: #fff; border-left: 4px solid var(--green); padding: 10px 14px; border-radius: 6px; }

.edit { display: flex; flex-direction: column; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.edit label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; color: var(--muted); }
.edit input, .edit select { font-size: 1rem; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.edit .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.edit .row label, .edit .row input { min-width: 0; }

button { font: inherit; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
button.primary { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
button.danger { color: var(--red); border-color: #e5bdb4; margin-top: 16px; width: 100%; }

.fields { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0; }
.fields dt { color: var(--muted); font-size: .88rem; }
.fields dd { margin: 0; word-break: break-word; }
.fields code { font-size: .8rem; }

.version { text-align: center; color: var(--muted); font-size: .75rem; padding: 0 16px max(16px, env(safe-area-inset-bottom)); }

.meta { color: var(--muted); font-size: .82rem; margin-top: 20px; }

/* Navigation */

/* Fiche document */
.doc-head { margin: 6px 0 12px; }
.doc-head h1 { margin: 6px 0 2px; }
.issuer-link { color: var(--green); font-weight: 600; text-decoration: none; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 12px; }
.fact { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.fact span { display: block; font-size: .78rem; color: var(--muted); }
.fact strong { font-size: 1.02rem; white-space: nowrap; }
.fact.due-soon { border-color: var(--amber); background: #fbf1e3; }
.fact.due-soon strong { color: var(--amber); }
.pages { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.page { position: relative; display: block; }
.page img { width: 100%; display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.page-num { position: absolute; right: 10px; bottom: 10px; background: rgba(31,42,34,.75); color: #fff; font-size: .78rem; padding: 2px 8px; border-radius: 999px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.actions form { display: contents; }
.button { display: inline-block; text-decoration: none; padding: 12px 16px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }
details.correct { margin-top: 20px; }
details.correct summary { cursor: pointer; font-weight: 600; color: var(--green); padding: 10px 0; }

/* Émetteurs */
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--green-light); color: var(--green); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1.1rem; flex: none; }
.count-big { font-weight: 700; font-size: 1.1rem; }
.muted { color: var(--muted); font-size: .88rem; }
.warn { color: var(--amber); }
.tag-red { background: #f8e6e2; color: var(--red); }
.info { margin-bottom: 8px; }
.info form { margin-top: 10px; }

.button.primary { background: var(--green); color: #fff; border-color: var(--green); font-weight: 600; }
.button.block { display: block; text-align: center; margin-bottom: 4px; }
.card-title.wrap { white-space: normal; }
.result { align-items: center; }
.result button { flex: none; padding: 10px 14px; }
.results { margin-top: 14px; }

/* Glisser-déposer */
.drop-hint { display: none; }
@media (pointer: fine) { .drop-hint { display: inline; } }
.drop-overlay {
  position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center;
  background: rgba(47, 93, 58, .88); color: #fff; font-size: 1.3rem; font-weight: 600; text-align: center;
  border: 4px dashed rgba(255,255,255,.7); border-radius: 18px; margin: 10px; pointer-events: none;
}
.drop-overlay .upload-icon { font-size: 3rem; }
.drop-overlay.visible { display: flex; }
.search + .cards { margin-top: 12px; }

/* TVA */
.vat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 12px; font-size: .92rem; }
.vat-row { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); }
.vat-row strong { color: var(--ink); margin-left: 4px; }
.vat.mismatch { border-color: var(--amber); }
.vat .warn { margin-top: 6px; }
.vat-lines { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: .85rem; }
.vat-lines th { text-align: left; color: var(--muted); font-weight: 400; }
.vat-lines td, .vat-lines th { padding: 3px 0; border-top: 1px solid var(--line); }
.edit .row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.transcription { white-space: pre-wrap; word-break: break-word; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; font-size: .82rem; max-height: 60vh; overflow: auto; }

/* Calendrier */
.late-pill { margin-left: 8px; background: #f8e6e2; color: var(--red); padding: 2px 10px; border-radius: 999px; font-size: .78rem; text-decoration: none; text-transform: none; letter-spacing: 0; }
.deadlines .see-all a { justify-content: center; color: var(--green); font-weight: 600; }
.deadline { display: flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px; scroll-margin-top: 80px; }
.deadline .check button { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: #fff; font-weight: 700; flex: none; }
.deadline.is-done .check button { background: var(--green); border-color: var(--green); }
.deadline.is-done .deadline-title { text-decoration: line-through; color: var(--muted); }
.deadline.is-late { border-color: #e5bdb4; background: #fdf5f3; }
.deadline.is-late .card-meta span:first-child { color: var(--red); font-weight: 600; }
.deadline-body { flex: 1; min-width: 0; }
.deadline-title { font-weight: 600; }
.deadline-title .kind { display: inline-block; width: 1.3em; text-align: center; }
.deadline-side { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.more { position: relative; }
.more summary { list-style: none; cursor: pointer; padding: 4px 8px; border-radius: 8px; color: var(--muted); font-size: 1.2rem; }
.more summary::-webkit-details-marker { display: none; }
.more-menu { position: absolute; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.12); padding: 6px; min-width: 190px; display: flex; flex-direction: column; }
.more-menu a, .more-menu button { text-align: left; padding: 9px 10px; border: 0; background: none; text-decoration: none; font-size: .92rem; border-radius: 6px; }
.more-menu a:hover, .more-menu button:hover { background: var(--wheat); }
.link-danger { color: var(--red); }
.late-box { background: #fdf5f3; border: 1px solid #e5bdb4; border-radius: var(--radius); padding: 4px 10px 6px; margin-bottom: 14px; }
.late-box h2 { color: var(--red); margin-top: 10px; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.month-nav h1 { margin: 0; font-size: 1.25rem; }
.month-nav .button { padding: 6px 14px; font-size: 1.2rem; }
.center { text-align: center; }
.month { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; margin: 10px 0 4px; }
.month th { font-size: .75rem; color: var(--muted); font-weight: 600; }
.month td { background: #fff; border-radius: 8px; height: 46px; vertical-align: top; padding: 0; }
.month td.other { background: transparent; color: #c2bba9; }
.month td.today { outline: 2px solid var(--green); }
.month .day { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 5px; height: 100%; font-size: .88rem; text-decoration: none; }
.month .has-events { font-weight: 700; color: var(--green); }
.dots { display: flex; gap: 3px; margin-top: 3px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.dot.kind-paiement { background: var(--amber); }
.dot.kind-rendez-vous { background: #2b6cb0; }
.dot.kind-limite { background: var(--red); }
.dot.kind-info { background: #8a9a8d; }
.dot.done { opacity: .35; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); justify-content: center; }
.day-title { text-transform: none; letter-spacing: 0; font-size: .95rem; color: var(--ink); margin: 18px 0 6px; scroll-margin-top: 80px; }
.small-links { font-size: .85rem; margin-top: 18px; }
.doc-deadlines { margin-bottom: 8px; }

/* Comptes */
.creds { background: #fffbea; border: 2px solid var(--amber); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.creds code { font-size: 1.15rem; background: #fff; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); user-select: all; }
.farm-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.farm-box h3 { margin: 0 0 6px; font-size: 1rem; }
.user-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.user-row .who { flex: 1; min-width: 140px; }
.user-row form { display: inline; }
.user-row button { padding: 6px 10px; font-size: .85rem; }
.badge { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: var(--green-light); color: var(--green); font-weight: 600; }
.badge.off { background: #eee; color: var(--muted); }
.flash.err { background: #f8e6e2; border-color: #e5bdb4; color: var(--red); }
.checkbox { flex-direction: row !important; align-items: center; gap: 8px !important; }
.checkbox input { width: auto !important; }
#new-farm { display: flex; flex-direction: column; gap: 12px; }

/* Accueil : jours et pages */
.cards + .day-title { margin-top: 22px; }
.result-count { margin: 4px 0 0; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 20px 0 4px; }
.pager .button { padding: 10px 14px; }

/* Synthèse */
:root { --chart: #3a8a4a; --chart-soft: #e3efe4; --gridline: #ece7da; }
.export-btn { margin: 10px 0 14px; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.tile span { font-size: .8rem; color: var(--muted); }
.tile strong { font-size: 1.25rem; white-space: nowrap; }
.tile small { color: var(--muted); font-size: .78rem; }
.tile-alert { border-color: #e5bdb4; background: #fdf5f3; }
.tile-alert span, .tile-alert strong { color: var(--red); }
.chart-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; }
.chart-card h2 { margin-top: 2px; text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 1rem; }
.chart-card h2 .muted { font-weight: 400; }

/* Colonnes : une série, barres ≤ 24px, bout arrondi 4px, base carrée */
.columns { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 170px auto; column-gap: 6px; margin-top: 8px; }
.y-axis { position: relative; font-size: .7rem; color: var(--muted); min-width: 34px; }
.y-axis span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.plot { position: relative; display: grid; grid-template-columns: repeat(12, 1fr); align-items: end; border-bottom: 1px solid #cfc8b8; }
.plot .grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--gridline); }
.col { position: relative; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; }
.col .bar { width: min(24px, 70%); background: var(--chart); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; z-index: 1; }
.col.future .bar { opacity: .35; }
.col .cap { position: absolute; transform: translateY(-4px); font-size: .7rem; font-weight: 600; white-space: nowrap; z-index: 2; }
.col .tip { display: none; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .75rem; padding: 4px 8px; border-radius: 6px; white-space: nowrap; z-index: 5; }
.col:hover .tip, .col:focus .tip { display: block; }
.col:hover .bar, .col:focus .bar { filter: brightness(1.12); }
.col:first-child .tip { left: 0; transform: none; }
.col:last-child .tip { left: auto; right: 0; transform: none; }
.x-axis { grid-column: 2; display: grid; grid-template-columns: repeat(12, 1fr); font-size: .68rem; color: var(--muted); text-align: center; padding-top: 4px; }
.x-axis .now { color: var(--ink); font-weight: 700; }

/* Barres horizontales */
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; align-items: center; gap: 8px; text-decoration: none; font-size: .88rem; }
.hbar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; }
.hbar-fill { display: block; height: 100%; min-width: 3px; background: var(--chart); border-radius: 0 4px 4px 0; }
.hbar:hover .hbar-fill { filter: brightness(1.12); }
.hbar-value { font-weight: 600; white-space: nowrap; font-size: .85rem; }

.table-view summary { cursor: pointer; color: var(--green); font-size: .85rem; margin-top: 8px; }
.table-view table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: 6px; }
.table-view td, .table-view th { padding: 5px 10px 5px 0; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-view td:last-child, .table-view th:last-child { padding-right: 0; }
.num { text-align: right !important; white-space: nowrap; }
.table-view .total td { font-weight: 700; }
.check-group summary { cursor: pointer; padding: 8px 0; border-top: 1px solid var(--line); }
.check-group:first-of-type summary { border-top: 0; }
.check-group ul { margin: 0 0 8px; padding-left: 20px; font-size: .9rem; }
.badge-count { display: inline-block; min-width: 24px; text-align: center; background: #fbf1e3; color: var(--amber); font-weight: 700; border-radius: 999px; padding: 1px 7px; margin-right: 4px; }
/* Export */
fieldset.cats { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; }
fieldset.cats legend { font-size: .88rem; color: var(--muted); padding: 0 4px; }
fieldset.cats .checkbox { font-size: .88rem; color: var(--ink); }
.export-summary { margin-top: 14px; }
.export-summary .tiles { margin-bottom: 10px; }
.block-btn { width: 100%; margin-top: 12px; }

/* ======================================================================
   Mise en page : menu latéral (ordinateur) / barre d'onglets (mobile)
   ====================================================================== */
.sidebar { display: none; }
.topbar.plain { justify-content: center; }
.tab-photo input, .side-add input { display: none; }

/* Mobile */
.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
  background: #fff; border-top: 1px solid var(--line);
  /* Marge pour la barre d'accueil des iPhone, plafonnée : certains navigateurs la comptent même quand
     leur propre barre d'outils occupe déjà le bas de l'écran (bande blanche en haut de page) */
  --tabbar-safe: min(env(safe-area-inset-bottom, 0px), 12px);
  padding-bottom: var(--tabbar-safe); }
.tabbar a, .tab-photo { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 2px 8px;
  font-size: .7rem; color: var(--muted); text-decoration: none; }
.tabbar .ico { font-size: 1.25rem; line-height: 1.1; }
.tabbar a.active { color: var(--green); font-weight: 700; }
.tab-photo { cursor: pointer; }
.tab-photo .ico { width: 56px; height: 56px; margin-top: -24px; border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  box-shadow: 0 3px 10px rgba(47, 93, 58, .35); border: 4px solid var(--wheat); }
body.with-nav .container { padding-bottom: 24px; }
body.with-nav .version { padding-bottom: calc(84px + min(env(safe-area-inset-bottom, 0px), 12px)); }
.drop-overlay.sending { pointer-events: auto; }

/* Ordinateur */
@media (min-width: 900px) {
  body.with-nav { padding-left: 250px; }
  body.with-nav .topbar, body.with-nav .tabbar, body.with-nav .version { display: none; }
  .sidebar { display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; width: 250px; background: var(--green);
    color: #fff; padding: 18px 14px 12px; overflow-y: auto; z-index: 40; }
  .side-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.1rem; padding: 4px 8px 16px; }
  .side-add { display: block; background: #fff; color: var(--green); border-radius: 12px; padding: 12px; font-weight: 700;
    text-align: center; cursor: pointer; margin-bottom: 18px; }
  .side-add:hover { background: var(--green-light); }
  .side-add small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; margin-top: 2px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav form { margin: 0; }
  .side-nav a, .side-logout { display: flex; gap: 10px; align-items: center; color: #e7efe6; text-decoration: none;
    padding: 10px; border-radius: 10px; font: inherit; font-size: .95rem; background: none; border: 0; width: 100%;
    text-align: left; cursor: pointer; }
  .side-nav a:hover, .side-logout:hover { background: rgba(255, 255, 255, .1); }
  .side-nav a.active { background: rgba(255, 255, 255, .18); color: #fff; font-weight: 700; }
  .side-nav .ico { width: 1.4em; text-align: center; }
  .side-bottom { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 10px; }
  .side-version { font-size: .7rem; color: rgba(255, 255, 255, .55); padding: 8px 10px 0; }
  body.with-nav .container { max-width: 1180px; padding: 28px 36px 48px; }
}

/* Sections propres à un type d'écran */
@media (max-width: 899px) { .desktop-only { display: none !important; } }
@media (min-width: 900px) { .mobile-only { display: none !important; } }

/* Tableau de bord : deux colonnes sur ordinateur */
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.page-head h1 { margin: 0; flex: 1; }
.year-nav { display: flex; align-items: center; gap: 8px; }
.year-nav .button { padding: 6px 12px; }
.hero-photo { margin-bottom: 14px; }
.dash-grid { display: block; }
@media (min-width: 900px) {
  .dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 16px; align-items: start; }
  .tiles { margin-bottom: 16px; }
}
.deadlines.flat { border: 0; border-radius: 0; margin: 0 -14px; }
.deadlines.flat li { border-top: 1px solid var(--line); }
.deadlines.flat li:first-child { border-top: 0; }
.see-more { display: block; text-align: right; color: var(--green); font-weight: 600; text-decoration: none; font-size: .88rem; margin-top: 8px; }
.cards.compact { gap: 6px; }
.cards.compact .card { padding: 8px 10px; }
.cards.compact .thumb { width: 36px; height: 48px; }

/* Documents : barre d'outils et tableau (ordinateur) */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.toolbar input[type=search] { margin-top: 0; flex: 1; }
.toolbar select { font-size: 1rem; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.doc-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: .92rem; }
.doc-table thead th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #faf8f2; }
.doc-table td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.doc-table tbody tr:not(.group) { cursor: pointer; }
.doc-table tbody tr:not(.group):hover td { background: #f7f4ec; }
.doc-table tr.group th { text-align: left; padding: 14px 12px 6px; font-size: .9rem; border-top: 1px solid var(--line); background: #fff; }
.doc-table tbody:first-of-type tr.group th { border-top: 0; }
.doc-table .cell-thumb { width: 48px; padding-right: 0; }
.doc-table .thumb { width: 36px; height: 48px; }
.doc-table .cell-title a { font-weight: 600; text-decoration: none; }
.doc-table .cell-issuer a { text-decoration: none; }
.doc-table .cell-issuer a:hover, .doc-table .cell-title a:hover { text-decoration: underline; }
.doc-table .due { color: var(--amber); font-weight: 600; }
.nowrap { white-space: nowrap; }
.small { font-size: .8rem; }

/* Documents : indicateurs et barre d'outils */
.doc-tiles { margin-bottom: 12px; }
.tile-warn { border-color: #f0d3a8; background: #fdf7ee; }
.tile-warn span, .tile-warn strong { color: var(--amber); }
.tile-active { outline: 2px solid var(--amber); }
.toolbar { flex-wrap: wrap; }
.toolbar input[type=search] { min-width: 220px; }
@media (max-width: 899px) {
  .toolbar select { flex: 1 1 100%; font-size: .9rem; padding: 9px 10px; }
  .doc-tiles .tile strong { font-size: 1.1rem; }
  .doc-tiles .tile small { display: none; }
}
