/* =========================================================
   TOKENS — charte Amoseeds : vert #1A3526, or #C2AB29, vert feuille #82A130,
   noir #222223, crème #F2E9E0. Arrondis : 4 px partout.
   ========================================================= */
:root {
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 4px;
  --font-display: "Archivo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "Helvetica Now Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --a-logo: url("/assets/amoseeds-logo.png");

  --green: #1A3526;
  --gold: #C2AB29;
  --leaf: #82A130;
  --nutri: #309E85;

  --bg: #F7F4EF;
  --surface: #FFFFFF;
  --surface-soft: #FBFAF7;
  --ink: #222223;
  --muted: #4F5B54;
  --line: #E4DED3;
  --title: #1A3526;
  --chip: #EEF3E2;
  --a-logo-color: #1A3526;
  --btn: #1A3526;
  --btn-ink: #FFFFFF;
  --focus: #C2AB29;
}
html { scroll-padding-top: env(safe-area-inset-top, 0px); }
*, *::before, *::after { box-sizing: inherit; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1F17; --surface: #142820; --surface-soft: #11231B; --ink: #EFEDE6; --muted: #A9B4AB;
    --line: #28402F; --title: #F2E9E0; --chip: #22402C; --a-logo-color: #F2E9E0;
    --btn: #C2AB29; --btn-ink: #1A3526;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1F17; --surface: #142820; --surface-soft: #11231B; --ink: #EFEDE6; --muted: #A9B4AB;
  --line: #28402F; --title: #F2E9E0; --chip: #22402C; --a-logo-color: #F2E9E0;
  --btn: #C2AB29; --btn-ink: #1A3526;
}

/* Logos clairs / sombres */
.only-dark { display: none !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .only-dark { display: block !important; }
  :root:not([data-theme="light"]) .only-light { display: none !important; }
}
:root[data-theme="dark"] .only-dark { display: block !important; }
:root[data-theme="dark"] .only-light { display: none !important; }

/* =========================================================
   BASE
   ========================================================= */
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.55;
}
h1, h2, h3 { font-family: var(--font-display); color: var(--title); margin: 0; line-height: 1.15; }
h1 { font-size: 34px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 18px; font-weight: 700; }
p { margin: 0; }
a { color: var(--title); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.grow { flex: 1; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; display: flex; flex-direction: column; gap: 28px; }
.view { display: flex; flex-direction: column; gap: 28px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* Logo Amoseeds : masque recolorable */
.a-logo {
  display: block; aspect-ratio: 640 / 189; background-color: var(--a-logo-color);
  -webkit-mask: var(--a-logo) no-repeat center / contain; mask: var(--a-logo) no-repeat center / contain;
}

/* =========================================================
   EN-TÊTE ET NAVIGATION
   ========================================================= */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.brands { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; text-decoration: none; }
.brands .a-logo { height: 46px; }
.brands-sep { width: 1px; height: 36px; background: var(--line); }
.logo-nujime, .logo-nutri { height: 26px; width: auto; display: block; }

.who { display: flex; align-items: center; gap: 12px; }
.avatar { width: 40px; height: 40px; border-radius: 999px; background: var(--chip); color: var(--title); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.who-text { display: flex; flex-direction: column; line-height: 1.25; }
.who-text strong { font-size: 14px; }
.who-text span { font-size: 12px; color: var(--muted); }
.linkbtn { background: none; border: 0; padding: 8px; min-height: 44px; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; }

.main-nav { background: var(--green); }
.nav-inner { display: flex; flex-wrap: wrap; padding-left: 12px; padding-right: 12px; }
.main-nav a {
  color: #FFFFFF; text-decoration: none; font-size: 15px; font-weight: 500;
  padding: 14px 14px 11px; border-bottom: 3px solid transparent;
}
.main-nav a:hover { border-bottom-color: rgba(194, 171, 41, .5); }
.main-nav a[aria-current="page"] { font-weight: 700; border-bottom-color: var(--gold); }

/* =========================================================
   PANNEAU VERT À FILET OR (signature de la charte)
   ========================================================= */
.panel { background: var(--green); border-radius: var(--radius); padding: 10px; }
.panel-frame { border: 1.5px solid var(--gold); border-radius: 2px; padding: 36px 32px; }
.panel h1 { color: #FFFFFF; font-size: 40px; line-height: 1.1; }
.panel p { color: #DDE3DA; font-size: 16px; }
.eyebrow { display: block; font-size: 13px; letter-spacing: .24em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px; }
.hero h1 { margin-bottom: 8px; }
.hero-date { color: #DDE3DA; font-size: 14px; }

.gate-inner { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.g-btn { min-height: 44px; }
.gate-error { color: #FFFFFF; background: rgba(228, 87, 46, .25); border: 1px solid #E4572E; border-radius: var(--radius); padding: 10px 14px; }

/* =========================================================
   TUILES DE RUBRIQUES
   ========================================================= */
.tiles { display: flex; flex-wrap: wrap; gap: 14px; }
.tile {
  flex: 1 1 170px; min-height: 150px; display: flex; flex-direction: column; gap: 8px;
  padding: 18px 16px; text-decoration: none; color: var(--ink);
  background: var(--surface-soft); border: 1px solid var(--line); border-top: 3px solid var(--line); border-radius: var(--radius);
}
.tile.is-active { background: var(--surface); border-top-color: var(--gold); }
.tile.is-active:hover { border-color: var(--gold); }
.tile-title { font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--muted); }
.tile.is-active .tile-title { color: var(--title); }
.tile-desc { font-size: 13px; color: var(--muted); flex: 1; }

.ico, .ico-sm { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ico { width: 28px; height: 28px; color: var(--muted); }
.tile.is-active .ico { color: var(--title); }
.ico-sm { width: 20px; height: 20px; color: var(--title); }

.badge {
  align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border-radius: var(--radius); background: var(--line); color: var(--muted);
}
.badge-ok { background: var(--chip); color: var(--title); }

/* =========================================================
   CARTES
   ========================================================= */
.row-3 { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.cards { display: flex; flex-wrap: wrap; gap: 18px; }
.card {
  flex: 1 1 300px; display: flex; flex-direction: column; gap: 10px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.card-wide { flex: 2 1 380px; }
.card-accent { border-top: 3px solid var(--gold); }
.card-nutri { border-top-color: var(--nutri); }
.card-soon { background: var(--surface-soft); }
.card-soon h3, .card-soon p { color: var(--muted); }
.card-logo { height: 24px; width: auto; display: block; align-self: flex-start; }
.a-logo-card { height: 30px; align-self: flex-start; }
.card-meta { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.card-for { font-size: 13px; color: var(--muted); }
.empty {
  flex: 1; min-height: 140px; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 20px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--radius); font-size: 14px;
}
.payfit { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; }
.payfit .stack-sm { max-width: 560px; }
.payfit-logo { height: 40px; width: auto; align-self: flex-start; }
.construction { align-items: center; text-align: center; padding: 56px 24px; gap: 14px; }
.construction h1 { font-size: 30px; }

/* =========================================================
   BOUTONS, LIENS, FILTRES
   ========================================================= */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.construction .actions { justify-content: center; }
.btn {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  padding: 10px 16px; border-radius: var(--radius); border: 1.5px solid var(--btn);
  background: var(--btn); color: var(--btn-ink); text-decoration: none; font-weight: 700; font-size: 14px; cursor: pointer;
}
.btn:hover { filter: brightness(1.12); }
.btn-ghost { background: transparent; color: var(--title); border-color: var(--title); }
.btn[target="_blank"]::after { content: "↗"; font-weight: 400; }

.quick { display: flex; flex-wrap: wrap; gap: 12px; }
.quick-link {
  flex: 1 1 180px; min-height: 52px; display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 14px;
}
.quick-link:hover { border-color: var(--gold); }
.quick-img { width: 22px; height: 22px; border-radius: var(--radius); }

.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.more { font-size: 14px; font-weight: 700; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink); font-weight: 700; }
.page-title { display: flex; flex-direction: column; gap: 6px; }
.page-title p { color: var(--muted); max-width: 720px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.filter {
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius); cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 14px;
}
.filter[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }

.alert { padding: 12px 16px; border-radius: var(--radius); border: 1px solid #E4572E; background: #FDECE6; color: #7A2A12; }

/* =========================================================
   ACTUALITÉS ET ARTICLES
   ========================================================= */
.une { display: flex; flex-direction: column; gap: 14px; }
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start;
  padding: 14px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius);
}
.news-list .news { background: var(--surface); }
.news-photo { flex: 0 0 140px; width: 140px; height: 105px; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.news-body { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.news-date { font-size: 13px; color: var(--muted); }
.news-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 17px; color: var(--title); line-height: 1.25; }
.news-featured { padding: 0; overflow: hidden; background: var(--surface); }
.news-featured .news-photo { flex: 1 1 260px; width: auto; max-width: 100%; height: 220px; border-radius: 0; }
.news-featured .news-body { padding: 18px 18px 18px 4px; flex: 1 1 260px; }
.news-featured .news-title { font-size: 22px; }
.badge-important { background: var(--green); color: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge-important { background: var(--gold); color: var(--green); }
}
:root[data-theme="dark"] .badge-important { background: var(--gold); color: var(--green); }

.article { max-width: 820px; width: 100%; padding: 32px; gap: 18px; }
.article-head { display: flex; flex-direction: column; gap: 8px; }
.article-head h1 { font-size: 32px; }
.article-photo { width: 100%; max-height: 420px; object-fit: cover; border-radius: var(--radius); }
.article-body { font-size: 16px; line-height: 1.7; display: flex; flex-direction: column; gap: 14px; }
.article-body h2 { font-size: 24px; margin-top: 10px; }
.article-body h3 { font-size: 20px; margin-top: 6px; }
.article-body h4 { font-size: 17px; }
.article-body ul, .article-body ol { margin: 0; padding-left: 24px; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.article-body blockquote { margin: 0; padding: 10px 16px; border-left: 3px solid var(--gold); background: var(--surface-soft); }
.article-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.article-body td, .article-body th { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.article-body hr { border: 0; border-top: 1px solid var(--line); width: 100%; }

@media (max-width: 640px) {
  .news-featured .news-body { padding: 4px 16px 16px; }
  .news-photo { flex-basis: 100%; width: 100%; height: 180px; }
  .article { padding: 20px 16px; }
  .article-head h1 { font-size: 26px; }
}

/* =========================================================
   ANNIVERSAIRES
   ========================================================= */
.small { font-size: 13px; }
.anniv { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.anniv .empty { min-height: 120px; }
.anniv-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft);
}
.anniv-item.is-today { border-color: var(--gold); background: var(--surface); box-shadow: inset 3px 0 0 var(--gold); }
.anniv-avatar {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #FFFFFF;
}
.anniv-avatar.is-amo { background: var(--green); }
.anniv-avatar.is-nutri { background: #223F48; }
.anniv-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.anniv-text span { font-size: 13px; color: var(--muted); }
.anniv-item.is-today .anniv-text span { color: var(--title); font-weight: 700; }
.anniv-company { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: var(--radius); }
.anniv-company.is-amo { background: var(--chip); color: var(--title); }
.anniv-company.is-nutri { background: #DCEFEA; color: #223F48; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .anniv-avatar.is-amo { background: var(--gold); color: var(--green); }
  :root:not([data-theme="light"]) .anniv-company.is-nutri { background: #1E3A40; color: #CFEAE3; }
}
:root[data-theme="dark"] .anniv-avatar.is-amo { background: var(--gold); color: var(--green); }
:root[data-theme="dark"] .anniv-company.is-nutri { background: #1E3A40; color: #CFEAE3; }

/* =========================================================
   SALLE DE RÉUNION
   ========================================================= */
.salle { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.salle .empty { min-height: 110px; }
.salle-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft);
}
.salle-item.is-now { border-color: var(--gold); background: var(--surface); box-shadow: inset 3px 0 0 var(--gold); }
.salle-item.is-past { opacity: .6; }
.salle-time { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 112px; }
.salle-label { flex: 1; min-width: 0; color: var(--muted); font-size: 14px; }
.salle-item.is-now .salle-label { color: var(--ink); }

/* =========================================================
   ACCUEIL EN DEUX RANGÉES + ABSENTS
   ========================================================= */
.row-2 { display: flex; flex-wrap: wrap; gap: 20px; align-items: stretch; }
.row-2 > .card { flex: 1 1 340px; }
.tabs { display: flex; gap: 6px; }
.tab {
  min-height: 36px; padding: 6px 12px; border-radius: var(--radius); cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; font-size: 13px;
}
.tab[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.absents { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.absents .empty { min-height: 110px; }
.absent-day { font-size: 14px; font-family: var(--font-body); font-weight: 700; color: var(--muted); margin-top: 6px; }
.absent-day.is-today { color: var(--title); }
.absent-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.absent-item {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft);
}
.absent-pole { color: var(--muted); font-size: 14px; flex: 1; min-width: 0; }
.absent-plage { font-size: 13px; font-weight: 700; color: var(--title); }

/* =========================================================
   COLONNE D'INFOS DE L'ACCUEIL (notes de service + anniversaires)
   ========================================================= */
.side-col { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.side-col > .card { flex: none; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.note-list .empty { min-height: 80px; }
.note-item {
  display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--line); border-left: 3px solid var(--gold); border-radius: var(--radius); background: var(--surface-soft);
}
a.note-item:hover { background: var(--surface); border-color: var(--gold); }
.note-item strong { font-size: 14px; line-height: 1.35; color: var(--title); }
.note-date { font-size: 12px; color: var(--muted); }

/* =========================================================
   ANNUAIRE
   ========================================================= */
.annu-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.annu-search, .annu-filter { display: flex; flex-direction: column; gap: 6px; }
.annu-search { flex: 1 1 260px; }
.annu-search label, .annu-filter label, .annu-filter-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.annu-search input, .annu-filter select {
  min-height: 44px; padding: 10px 12px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius);
}
.annu-search input:focus, .annu-filter select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(194, 171, 41, .25); }
.annu-bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--gold); border-radius: var(--radius);
}
.annu-all { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; min-height: 44px; cursor: pointer; }
.annu-all input, .person input { width: 18px; height: 18px; accent-color: var(--green); }
.annu-count { color: var(--muted); font-size: 14px; flex: 1; min-width: 160px; }
.annu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.annu-actions .btn { align-self: auto; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .45; pointer-events: none; }
.annu-feedback { margin: 0; min-height: 20px; font-size: 14px; color: var(--title); font-weight: 700; }
.annu-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.annu-list .empty { min-height: 120px; }
.person {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.person:hover { border-color: var(--gold); }
.person.is-selected { border-color: var(--gold); box-shadow: inset 3px 0 0 var(--gold); }
.person-text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.person-poste { font-size: 13px; color: var(--muted); }
.person-email { font-size: 13px; color: var(--title); word-break: break-all; }
.person-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* =========================================================
   PASTILLES PHOTO DES COLLABORATEURS
   ========================================================= */
.anniv-avatar { overflow: hidden; }
.anniv-avatar.has-photo { background: transparent; }
.anniv-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 999px; display: block; }
.anniv-avatar.is-large { width: 52px; height: 52px; font-size: 16px; }

/* Boutons côte à côte en bas d'une carte (ex. bloc Absents) */
.card-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.card-actions .btn { align-self: auto; }

/* =========================================================
   PIED DE PAGE
   ========================================================= */
.site-footer { background: var(--green); color: #FFFFFF; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 28px; border-top: 3px solid var(--gold); }
.footer-logos { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.a-logo-white { height: 38px; background-color: #FFFFFF; }
.footer-nujime, .footer-nutri { height: 24px; width: auto; display: block; }
.footer-text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; text-align: right; }
.footer-text span { color: #D9DDD5; }

/* =========================================================
   TÉLÉPHONE
   ========================================================= */
@media (max-width: 640px) {
  .container { padding-left: 16px; padding-right: 16px; }
  h1, .panel h1 { font-size: 28px; }
  .panel-frame { padding: 24px 18px; }
  .who-text, .brands-sep { display: none; }
  .footer-text { text-align: left; }
  .main-nav a { padding: 12px 10px 9px; font-size: 14px; }
}
