/* ManaOrga — thème « océan » des applications Manatai : fond profond, cartes en verre, accents lagon et soleil. */
:root {
  --fond: #031519; --carte: rgba(255,255,255,.055); --carte-f: rgba(255,255,255,.09); --txt: #f3fafb; --txt2: #93b9c1; --bord: rgba(255,255,255,.1);
  --accent: #22d3e6; --accent-f: #0fa3b8; --soleil: #ffb627; --vert: #7ee081; --rose: #ff7b9c; --danger: #ff5a5f;
  --degrade: linear-gradient(135deg, #22d3e6 0%, #0fa3b8 55%, #0b7a8a 100%);
  --rayon: 18px; --ombre: 0 12px 34px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--fond); }
html, body { margin: 0; color: var(--txt); font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, system-ui, sans-serif; }
body {
  min-height: 100vh; overflow-x: hidden; padding: env(safe-area-inset-top) 0 0;
  background: radial-gradient(900px 520px at -10% -10%, rgba(34,211,230,.18), transparent 60%), radial-gradient(800px 600px at 50% 120%, rgba(255,182,39,.08), transparent 60%), linear-gradient(180deg, #05222a 0%, #031519 60%, #020f12 100%);
  background-attachment: fixed;
}
a { color: var(--accent); text-decoration: none; }
h1 { font-size: 1.3rem; margin: 0; letter-spacing: -.01em; }
h2 { font-size: .76rem; margin: 22px 0 10px; color: var(--txt2); text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
h3 { font-size: 1rem; margin: 0 0 4px; }
p { margin: 0 0 10px; }
small, .discret { color: var(--txt2); font-size: .84rem; }
[hidden] { display: none !important; }

/* Structure */
.tete { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: rgba(3,21,25,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--bord); }
.tete:empty { display: none; }
.tete h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tete .retour { font-size: 1.5rem; line-height: 1; padding: 2px 10px 4px 0; color: var(--txt); }
.main { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(96px + env(safe-area-inset-bottom)); }
.nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: rgba(3,21,25,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--bord); }
.nav a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border-radius: 12px; color: var(--txt2); font-size: .68rem; font-weight: 600; position: relative; }
.nav a span { font-size: 1.25rem; line-height: 1.2; }
.nav a.ici { color: var(--accent); background: rgba(34,211,230,.1); }
.nav a i { position: absolute; top: 2px; right: 18%; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--danger); color: #fff; font: 700 .66rem/17px inherit; font-style: normal; text-align: center; }
.bandeau { padding: 8px 16px; background: #5a3d00; color: #ffe2a6; font-size: .84rem; text-align: center; }
.attente { text-align: center; color: var(--txt2); padding: 40px 0; }

/* Cartes et listes */
.carte { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 14px 16px; margin: 0 0 12px; }
.carte.alerte { border-color: rgba(255,90,95,.55); background: rgba(255,90,95,.1); }
.carte.info { border-color: rgba(34,211,230,.45); background: rgba(34,211,230,.08); }
.carte.soleil { border-color: rgba(255,182,39,.5); background: rgba(255,182,39,.08); }
.liste { display: flex; flex-direction: column; gap: 8px; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--carte); border: 1px solid var(--bord); color: var(--txt); min-height: 56px; }
.ligne .corps { flex: 1; min-width: 0; }
.ligne strong { display: block; overflow: hidden; text-overflow: ellipsis; }
.ligne small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne.retard { border-color: rgba(255,90,95,.5); }
.ligne.fait strong { text-decoration: line-through; color: var(--txt2); }
.etq { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.etq:empty { display: none; }
.ligne .corps strong { white-space: normal; }
.pastille { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.barre-c { flex: none; width: 5px; align-self: stretch; border-radius: 3px; background: var(--accent); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .68rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; background: var(--carte-f); color: var(--txt2); white-space: nowrap; }
.badge.urgent { background: var(--danger); color: #fff; }
.badge.ok { background: rgba(126,224,129,.2); color: var(--vert); }
.badge.attention { background: rgba(255,182,39,.2); color: var(--soleil); }
.badge.accent { background: rgba(34,211,230,.18); color: var(--accent); }
.vide { text-align: center; color: var(--txt2); padding: 26px 10px; border: 1px dashed var(--bord); border-radius: var(--rayon); }

/* Boutons et formulaires */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--bord); background: var(--carte-f); color: var(--txt); font: 600 1rem inherit; cursor: pointer; text-align: center; }
.btn.primaire { background: var(--degrade); border-color: transparent; color: #022026; font-weight: 800; }
.btn.danger { color: var(--danger); border-color: rgba(255,90,95,.45); background: rgba(255,90,95,.08); }
.btn.petit { min-height: 36px; padding: 6px 12px; font-size: .86rem; border-radius: 11px; }
.btn.bloc { display: flex; width: 100%; }
.btn:disabled { opacity: .5; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.puces { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
.puces::-webkit-scrollbar { display: none; }
.puce { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--bord); background: var(--carte); color: var(--txt2); font: 600 .86rem inherit; cursor: pointer; white-space: nowrap; }
.puce.ici { background: rgba(34,211,230,.16); border-color: var(--accent); color: var(--accent); }
label { display: block; margin: 0 0 12px; font-size: .86rem; font-weight: 600; color: var(--txt2); }
input, select, textarea { display: block; width: 100%; margin-top: 5px; padding: 12px 13px; border-radius: 12px; border: 1px solid var(--bord); background: rgba(0,0,0,.28); color: var(--txt); font: 1rem inherit; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { display: inline-block; width: 20px; height: 20px; margin: 0; padding: 0; accent-color: var(--accent); flex: none; }
.coche { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin: 0 0 6px; border-radius: 12px; background: rgba(0,0,0,.2); border: 1px solid var(--bord); color: var(--txt); font-weight: 500; font-size: .95rem; }
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.coches2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { padding: 0; margin-bottom: 6px; font-size: .86rem; font-weight: 600; color: var(--txt2); }
.erreur { color: var(--danger); font-weight: 600; margin: 8px 0; }
.code-reprise { font: 800 2rem ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 18px 8px; border-radius: 16px; background: rgba(0,0,0,.35); border: 2px dashed var(--soleil); color: var(--soleil); margin: 12px 0; user-select: all; }

/* Accueil */
.heros { text-align: center; padding: 26px 0 6px; }
.heros img { width: 92px; height: 92px; border-radius: 24px; box-shadow: var(--ombre); }
.heros h1 { font-size: 1.8rem; margin: 14px 0 4px; }
.tuiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.tuile { display: block; padding: 14px; border-radius: 16px; background: var(--carte); border: 1px solid var(--bord); color: var(--txt); }
.tuile b { display: block; font-size: 1.7rem; line-height: 1.1; }
.tuile span { color: var(--txt2); font-size: .82rem; }
.tuile.rouge b { color: var(--danger); } .tuile.jaune b { color: var(--soleil); } .tuile.bleu b { color: var(--accent); }

/* Tâches : kanban */
.kanban { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 12px; }
.colonne { flex: none; width: 82%; max-width: 320px; scroll-snap-align: center; background: rgba(0,0,0,.18); border: 1px solid var(--bord); border-radius: var(--rayon); padding: 10px; }
.colonne h3 { display: flex; justify-content: space-between; padding: 4px 6px 10px; font-size: .9rem; }
.colonne .ligne { flex-wrap: wrap; }
.deplacer { display: flex; gap: 6px; width: 100%; justify-content: flex-end; }
.statuts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0; }
.statuts button { padding: 10px 2px; border-radius: 11px; border: 1px solid var(--bord); background: var(--carte); color: var(--txt2); font: 600 .78rem inherit; }
.statuts button.ici { background: rgba(34,211,230,.18); border-color: var(--accent); color: var(--accent); }
.commentaire { padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.2); margin-bottom: 8px; }
.commentaire p { margin: 2px 0 0; white-space: pre-wrap; }
.texte { white-space: pre-wrap; }

/* Messages */
.msgs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.msg { padding: 10px 14px 12px; border-radius: 16px 16px 16px 4px; background: var(--carte); border: 1px solid var(--bord); max-width: 94%; align-self: flex-start; }
.msg.mien { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: rgba(34,211,230,.1); border-color: rgba(34,211,230,.3); }
.msg.important { border-color: rgba(255,90,95,.6); background: rgba(255,90,95,.09); max-width: 100%; align-self: stretch; }
.msg-tete { display: flex; align-items: baseline; gap: 8px; }
.msg-tete strong { font-size: .86rem; } .msg-tete small { flex: 1; font-size: .74rem; }
.msg-menu { flex: none; width: 34px; height: 28px; margin: -4px -8px 0 0; border: 0; border-radius: 10px; background: none; color: var(--txt2); font-size: 1.2rem; line-height: 1; }
.msg-etq { margin: 6px 0 0; }
.msg .texte { margin: 4px 0 0; overflow-wrap: anywhere; }
.msg .liste, .msg .actions { margin: 8px 0 0; }
.composer { position: sticky; bottom: calc(66px + env(safe-area-inset-bottom)); padding: 10px; border-radius: 16px; background: #07262e; border: 1px solid var(--bord); box-shadow: var(--ombre); }
.composer textarea { min-height: 52px; margin: 0; }
.composer .actions { margin: 8px 0 0; align-items: center; }

/* Calendrier */
.mois-tete { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mois-tete strong { display: inline-block; }
.mois-tete strong::first-letter { text-transform: uppercase; }
.mois { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.mois .jsem { text-align: center; font-size: .7rem; color: var(--txt2); padding-bottom: 2px; }
.jour { min-height: 52px; padding: 4px 2px; border-radius: 10px; background: var(--carte); border: 1px solid transparent; text-align: center; font-size: .84rem; cursor: pointer; }
.jour.hors { opacity: .35; } .jour.auj { border-color: var(--accent); } .jour.choisi { background: rgba(34,211,230,.16); } .jour.edition { box-shadow: inset 0 -3px 0 var(--soleil); }
.jour .points { display: flex; justify-content: center; gap: 3px; margin-top: 5px; flex-wrap: wrap; }
.jour .points i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.jdate { margin: 16px 0 8px; font-weight: 700; }
.jdate::first-letter { text-transform: uppercase; }
.heure { flex: none; width: 54px; font-size: .82rem; color: var(--txt2); text-align: center; }

/* Barres (effectifs, statuts) */
.barres .b { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; font-size: .86rem; }
.barres .b span:first-child { flex: none; width: 104px; color: var(--txt2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barres .b div { flex: 1; height: 12px; border-radius: 6px; background: rgba(255,255,255,.07); overflow: hidden; }
.barres .b div i { display: block; height: 100%; border-radius: 6px; background: var(--degrade); }
.barres .b b { flex: none; width: 34px; text-align: right; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 8px 6px; text-align: left; border-bottom: 1px solid var(--bord); }
th { color: var(--txt2); font-weight: 600; font-size: .76rem; } td.n, th.n { text-align: right; }

/* Feuille (formulaires et détails en surimpression) */
.feuille { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(0,0,0,.6); }
.feuille .f-corps { width: 100%; max-width: 720px; max-height: 92vh; overflow-y: auto; background: #07262e; border-radius: 22px 22px 0 0; border: 1px solid var(--bord); padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); }
.feuille .f-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.feuille .f-tete h3 { flex: 1; font-size: 1.1rem; margin: 0; }
.feuille .f-fermer { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--carte-f); color: var(--txt); font-size: 1.2rem; }
.feuille img.apercu { max-width: 100%; border-radius: 12px; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; max-width: 88%; padding: 12px 18px; border-radius: 14px; background: #0c3e4a; border: 1px solid var(--accent); color: var(--txt); font-weight: 600; box-shadow: var(--ombre); text-align: center; }
.toast.err { background: #4a1416; border-color: var(--danger); }

/* --- Postes et créneaux, budget, repas (lot 3) --- */
.defile { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.defile table { white-space: nowrap; }
.matrice td:first-child, .matrice th:first-child { position: sticky; left: 0; background: #0b2a32; white-space: normal; min-width: 104px; max-width: 150px; }
.matrice td.n, .matrice th.n { text-align: center; padding: 7px 4px; }
.matrice th.ici a { color: var(--soleil); }
tr.choisi td { background: rgba(34,211,230,.1); }
.poste.sous { margin-left: 16px; }
.p-tete { display: flex; align-items: flex-start; gap: 10px; }
.p-tete > div { flex: 1; min-width: 0; }
.besoin { padding: 10px 0 4px; border-top: 1px solid var(--bord); }
.b-tete { display: flex; align-items: center; gap: 8px; }
.b-tete strong { flex: 1; min-width: 0; font-size: .92rem; }
.b-tete strong::first-letter { text-transform: uppercase; }
.equipe { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 6px; }
.membre { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: .86rem; }
.membre.pb { background: rgba(255,182,39,.16); color: var(--soleil); }
.membre button { min-width: 30px; min-height: 30px; margin: -6px -8px -6px -4px; border: 0; background: none; color: var(--txt2); font-size: .9rem; }
.pb-texte { color: var(--soleil); font-size: .82rem; margin: 0 0 4px; }
.jauge { display: flex; height: 12px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; margin: 2px 0 12px; }
.jauge i { display: block; height: 100%; background: var(--degrade); }
.jauge i.eng { background: var(--soleil); opacity: .85; }
.chiffres { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 12px; margin-bottom: 10px; }
.chiffres b { display: block; font-size: 1.05rem; }
.chiffres span { color: var(--txt2); font-size: .78rem; }

@media (min-width: 760px) {
  .chiffres { grid-template-columns: repeat(4, 1fr); }
  .tuiles { grid-template-columns: repeat(4, 1fr); }
  .colonne { width: 24%; }
  .feuille { align-items: center; } .feuille .f-corps { border-radius: 22px; }
}
/* Impression de l'autorisation parentale : seule la feuille s'imprime, en noir sur blanc. */
@media print {
  body { background: #fff !important; color: #000; }
  .tete, .nav, .main, .toast, .bandeau, .f-tete button, .non-imprime { display: none !important; }
  .feuille { position: static; background: none; display: block; }
  .feuille .f-corps { max-height: none; background: #fff; color: #000; border: 0; overflow: visible; }
  .feuille .texte { font: 14pt/1.7 Georgia, serif; color: #000; }
  .feuille th, .feuille td, .feuille h2, .feuille h3, .feuille small, .feuille .discret, .feuille .carte { color: #000; border-color: #999; background: none; }
}
