/* ==========================================================================
   THEME COMMUN — habillage moderne appliqué à tout le site
   Chargé après les styles de chaque page pour les enrichir sans les casser.
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --brand: #1f8a52;
  --brand-strong: #156c3f;
  --brand-soft: #eaf6ee;
  --accent: #f0912b;
  --accent-soft: #fff3e2;
  --ink: #16241c;
  --ink-soft: #5c6b62;
  --surface: #ffffff;
  --ring: rgba(31, 138, 82, 0.14);
  --shadow-soft: 0 1px 2px rgba(16, 40, 28, 0.04),
                 0 8px 24px rgba(16, 40, 28, 0.08),
                 0 24px 60px rgba(16, 40, 28, 0.06);
  --radius-lg: 20px;
  --radius-md: 14px;
}

/* ---------- Typographie & fond global ---------- */
html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -8%, #ffffff 0%, transparent 55%),
    radial-gradient(900px 500px at 110% 0%, #dff0e4 0%, transparent 45%),
    linear-gradient(165deg, #f4f9f3 0%, #e6f1e7 100%) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, .page-title {
  letter-spacing: -0.01em;
  font-weight: 800;
}

/* Léger fondu d'apparition à l'ouverture des pages */
@keyframes theme-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
body > .container,
body > .wrap,
body > .home,
body > .layout,
body > main,
body > .card {
  animation: theme-fade-in 0.5s ease both;
}

/* ---------- Cartes & conteneurs ---------- */
.container, .wrap, .card,
.summary-card, .objective-card,
.rappels, .dashboard, .dashboard-tools,
.carte, .left-column {
  border-radius: 0 !important;
  box-shadow: none !important;
  border: none !important;
}

.summary-card, .objective-card, .carte, .res-bloc {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.summary-card:hover, .objective-card:hover, .carte:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(16, 40, 28, 0.06),
              0 18px 44px rgba(16, 40, 28, 0.12) !important;
}

/* ---------- En-têtes harmonisés ---------- */
.container > .header,
.wrap > .header,
.main-content > .header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
}

.container > .header h1,
.wrap > .header h1,
.main-content > .header h1,
.container > .header .page-title,
.wrap > .header .page-title,
.main-content > .header .page-title {
  margin: 0;
  text-align: center;
}

.container > .header .btn-back,
.wrap > .header .btn-back,
.main-content > .header .btn-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Boutons ---------- */
.btn-back, .btn, .menu-item, .rappels-lien, button.btn, .navfab {
  font-family: inherit;
}

.btn-back, .btn {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 20px rgba(21, 108, 63, 0.28) !important;
  letter-spacing: 0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease !important;
}
.btn-back:hover, .btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 12px 26px rgba(21, 108, 63, 0.34) !important;
}

.menu-item {
  border-radius: var(--radius-md) !important;
  background: var(--brand-soft) !important;
  border: 1.5px solid rgba(31, 138, 82, 0.35) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease !important;
}
.menu-item:hover {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%) !important;
  color: #fff !important;
  box-shadow: 0 12px 24px rgba(21, 108, 63, 0.3) !important;
}

/* Liens de la colonne latérale */
.left-column-link {
  border-radius: var(--radius-md) !important;
  border: 1px solid rgba(31, 138, 82, 0.14) !important;
  background: var(--brand-soft) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease !important;
}
.left-column-link:hover {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%) !important;
  color: #fff !important;
  box-shadow: 0 10px 20px rgba(21, 108, 63, 0.25) !important;
}

/* ---------- Champs de saisie ---------- */
input, select, textarea {
  font-family: inherit !important;
  border-radius: 10px !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease !important;
}
input:focus, select:focus, textarea:focus {
  outline: none !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 4px var(--ring) !important;
}

/* ---------- Anti-debordement global ---------- */
*, *::before, *::after {
  box-sizing: border-box;
}

img, svg, video, canvas, iframe {
  max-width: 100% !important;
  height: auto;
}

input, select, textarea, button {
  max-width: 100% !important;
}

pre, code, kbd, samp {
  white-space: pre-wrap;
  word-break: break-word;
}

:where(h1, h2, h3, h4, p, span, strong, a, label, td, th, button) {
  overflow-wrap: anywhere;
}

:where(.container, .wrap, .layout, .home, .main-content, main, section, article, aside, nav, div) {
  min-width: 0;
}

/* ---------- Menu flottant (harmonisation) ---------- */
.navfab {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%) !important;
  box-shadow: 0 12px 28px rgba(21, 108, 63, 0.35) !important;
}
.navfab:hover { filter: brightness(1.06); }
.navfab-link.actif {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%) !important;
}

/* ---------- Barre de défilement ---------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(31, 138, 82, 0.5) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
  background: rgba(31, 138, 82, 0.45);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(31, 138, 82, 0.7); background-clip: padding-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Plein écran sur mobile (aucun espace mort) ---------- */
@media (max-width: 820px) {
  body {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  .container,
  .wrap,
  .card {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .container > .header .btn-back,
  .wrap > .header .btn-back,
  .main-content > .header .btn-back {
    width: 100%;
    max-width: 360px;
  }

  /* Empêche tout tableau de déborder et décaler la page */
  table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  th, td {
    white-space: normal !important;
    word-break: break-word;
  }

  :where([class*="grid"], [class*="cards"], [class*="summary"], [class*="objectives"]) {
    grid-template-columns: 1fr !important;
  }

  :where([class*="row"], [class*="tools"]) {
    flex-wrap: wrap !important;
  }
}

/* ---------- Plein ecran global ---------- */
html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

body {
  margin: 0 !important;
  padding: 8px !important;
}

.container,
.wrap,
.home,
.layout,
.main-content,
main {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.card,
.summary-card,
.objective-card,
.rappels,
.dashboard,
.dashboard-tools,
.carte,
.left-column {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

