/* ==========================================================================
   NEENAM - Gestion Volaille - Thème
   ========================================================================== */

:root {
  --nm-yellow: #FFC107;
  --nm-yellow-dark: #F5A623;
  --nm-yellow-deep: #E8960A;
  --nm-orange: #FF8A3D;
  --nm-brown: #6B4A1E;
  --nm-cream: #FFFDF5;
  --nm-cream-2: #FFF8E7;
  --nm-ink: #2E2A22;
  --nm-ink-soft: #6b6558;
  --nm-line: #F0E4C8;
  --nm-green: #2FB380;
  --nm-red: #E5484D;
  --nm-blue: #3B82F6;
  --nm-radius: 16px;
  --nm-radius-sm: 10px;
  --nm-shadow: 0 4px 16px rgba(232, 150, 10, .08), 0 1px 3px rgba(43, 32, 6, .06);
  --nm-shadow-hover: 0 10px 28px rgba(232, 150, 10, .16), 0 2px 6px rgba(43, 32, 6, .08);
  --sidebar-w: 264px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, "Helvetica Neue", Arial, sans-serif;
  background: var(--nm-cream);
  color: var(--nm-ink);
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* ---------------- Layout ---------------- */
.app-wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, #FFFFFF 0%, var(--nm-cream-2) 100%);
  border-right: 1px solid var(--nm-line);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1040;
  transition: transform .28s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--nm-line);
}

.brand-logo {
  width: 46px; height: 46px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--nm-yellow);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-weight: 800; font-size: 1.25rem; letter-spacing: .5px; color: var(--nm-yellow-deep); }
.brand-sub { font-size: .72rem; color: var(--nm-ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--nm-radius-sm);
  color: var(--nm-ink-soft);
  font-weight: 600;
  font-size: .92rem;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-link-item i { font-size: 1.15rem; width: 22px; text-align: center; }

.nav-link-item:hover { background: var(--nm-cream-2); color: var(--nm-brown); transform: translateX(2px); }

.nav-link-item.active {
  background: linear-gradient(135deg, var(--nm-yellow) 0%, var(--nm-yellow-dark) 100%);
  color: #4A2E00;
  box-shadow: 0 4px 12px rgba(245, 166, 35, .35);
}

.sidebar-footer { padding: 12px; border-top: 1px solid var(--nm-line); }
.text-logout:hover { background: #FDEAEA; color: var(--nm-red); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(20, 15, 5, .35);
  z-index: 1035;
}

.main-area {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  background: #fff;
  border-bottom: 1px solid var(--nm-line);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 1020;
}

.topbar-title { font-size: 1.2rem; font-weight: 800; margin: 0; flex: 1; color: var(--nm-brown); }

.topbar-actions { display: flex; align-items: center; gap: 14px; }

.btn-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--nm-cream-2);
  color: var(--nm-brown);
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
  position: relative;
}
.btn-icon:hover { background: var(--nm-yellow); transform: translateY(-1px); }

.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--nm-red);
  color: #fff;
  font-size: .62rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid #fff;
}

.topbar-user { display: flex; align-items: center; gap: 10px; }
.avatar-circle {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nm-yellow), var(--nm-orange));
  color: #4A2E00;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.user-name { font-weight: 700; font-size: .86rem; }
.user-role { font-size: .72rem; color: var(--nm-ink-soft); }

.page-content {
  padding: 24px;
  flex: 1;
  animation: fadeSlideUp .35s ease backwards;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-alert { border-radius: var(--nm-radius-sm); border: none; box-shadow: var(--nm-shadow); }

/* ---------------- Cards ---------------- */
.card {
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  box-shadow: var(--nm-shadow);
  background: #fff;
}

.card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--nm-shadow-hover); }

/* KPI cards */
.kpi-card {
  border-radius: var(--nm-radius);
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--nm-line);
  box-shadow: var(--nm-shadow);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .2s ease, box-shadow .2s ease;
  animation: fadeSlideUp .4s ease both;
}
.kpi-card:hover { transform: translateY(-4px); box-shadow: var(--nm-shadow-hover); }

.kpi-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.kpi-icon.yellow { background: #FFF3CD; color: var(--nm-yellow-deep); }
.kpi-icon.green { background: #E3F7EE; color: var(--nm-green); }
.kpi-icon.red { background: #FDEAEA; color: var(--nm-red); }
.kpi-icon.blue { background: #E8F1FF; color: var(--nm-blue); }
.kpi-icon.orange { background: #FFEDE0; color: var(--nm-orange); }

.kpi-value { font-size: 1.5rem; font-weight: 800; color: var(--nm-ink); line-height: 1.1; }
.kpi-label { font-size: .78rem; color: var(--nm-ink-soft); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; }
.kpi-sub { font-size: .74rem; margin-top: 2px; }

/* stagger animation for grids of cards */
.stagger > * { animation: fadeSlideUp .4s ease both; }
.stagger > *:nth-child(1) { animation-delay: .02s; }
.stagger > *:nth-child(2) { animation-delay: .06s; }
.stagger > *:nth-child(3) { animation-delay: .10s; }
.stagger > *:nth-child(4) { animation-delay: .14s; }
.stagger > *:nth-child(5) { animation-delay: .18s; }
.stagger > *:nth-child(6) { animation-delay: .22s; }
.stagger > *:nth-child(7) { animation-delay: .26s; }
.stagger > *:nth-child(8) { animation-delay: .30s; }

/* ---------------- Buttons ---------------- */
.btn-neenam {
  background: linear-gradient(135deg, var(--nm-yellow) 0%, var(--nm-yellow-dark) 100%);
  border: none;
  color: #4A2E00;
  font-weight: 700;
  border-radius: var(--nm-radius-sm);
  padding: .55rem 1.2rem;
  box-shadow: 0 3px 10px rgba(245, 166, 35, .3);
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn-neenam:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(245, 166, 35, .4); color: #4A2E00; }
.btn-neenam:active { transform: translateY(0); }

.btn-outline-neenam {
  background: #fff;
  border: 1.5px solid var(--nm-yellow-dark);
  color: var(--nm-yellow-deep);
  font-weight: 700;
  border-radius: var(--nm-radius-sm);
  padding: .5rem 1.1rem;
  transition: background .15s ease;
}
.btn-outline-neenam:hover { background: var(--nm-cream-2); color: var(--nm-yellow-deep); }

.btn, .form-control, .form-select { border-radius: var(--nm-radius-sm); }
.form-control:focus, .form-select:focus { border-color: var(--nm-yellow-dark); box-shadow: 0 0 0 .2rem rgba(245, 166, 35, .18); }

/* Onglets (nav-pills) : bien visibles comme boutons cliquables même inactifs,
   pour que ce soit clair qu'on peut basculer entre les vues (poids/suivi/...). */
.nav-pills .nav-link {
  background: #fff;
  border: 1.5px solid var(--nm-line);
  color: var(--nm-ink-soft);
  font-weight: 700;
  font-size: .85rem;
  padding: .5rem 1rem;
  border-radius: 999px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.nav-pills .nav-link:hover { border-color: var(--nm-yellow-dark); color: var(--nm-brown); }
.nav-pills .nav-link.active {
  background: linear-gradient(135deg, var(--nm-yellow) 0%, var(--nm-yellow-dark) 100%);
  color: #4A2E00;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(245, 166, 35, .3);
}

.badge-soft {
  border-radius: 999px; padding: .35em .75em; font-weight: 700; font-size: .72rem;
  display: inline-block; max-width: 220px; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; vertical-align: middle;
}
.badge-soft.b-green { background: #E3F7EE; color: #1E9367; }
.badge-soft.b-red { background: #FDEAEA; color: #C13438; }
.badge-soft.b-yellow { background: #FFF3CD; color: #8A5A00; }
.badge-soft.b-blue { background: #E8F1FF; color: #2563EB; }
.badge-soft.b-grey { background: #F1EFE8; color: #6b6558; }

/* ---------------- Login ---------------- */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, #FFF6DD 0%, var(--nm-cream) 55%);
  background-size: 180% 180%;
  animation: authBgDrift 22s ease-in-out infinite;
  padding: 20px;
}
@keyframes authBgDrift {
  0%   { background-position: 20% 20%; }
  50%  { background-position: 75% 65%; }
  100% { background-position: 20% 20%; }
}

/* Icônes flottantes discrètes en fond de l'écran d'authentification */
.auth-bg-icons { position: absolute; inset: 0; overflow: hidden; z-index: 0; pointer-events: none; }
.auth-bg-icon {
  position: absolute;
  color: var(--nm-yellow-dark);
  opacity: .16;
  animation-name: authIconFloat;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}
.auth-bg-icon:nth-of-type(2n) { color: var(--nm-green); }
.auth-bg-icon:nth-of-type(3n) { color: var(--nm-blue); }
.auth-bg-icon:nth-of-type(5n) { color: var(--nm-orange); }
@keyframes authIconFloat {
  0%   { transform: translateY(0) rotate(0deg); }
  50%  { transform: translateY(-26px) rotate(8deg); }
  100% { transform: translateY(0) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .auth-screen { animation: none; }
  .auth-bg-icon { animation: none; }
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 22px;
  box-shadow: var(--nm-shadow-hover);
  padding: 34px 30px;
  animation: fadeSlideUp .5s ease both;
  text-align: center;
  position: relative;
  z-index: 1;
}
.auth-logo {
  width: 92px; height: 92px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 4px #fff, 0 0 0 7px var(--nm-yellow);
  margin: 0 auto 14px;
  animation: bounceIn .6s ease;
}
@keyframes bounceIn {
  0% { transform: scale(.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

/* ---------------- Tables responsive -> cards ---------------- */
.table-neenam thead th {
  background: var(--nm-cream-2);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--nm-ink-soft);
  font-weight: 700;
  border-bottom: none;
  white-space: nowrap;
}
.table-neenam td { vertical-align: middle; font-size: .88rem; }
.table-neenam tbody tr { transition: background .15s ease; }
.table-neenam tbody tr:hover { background: var(--nm-cream-2); }

@media (max-width: 767.98px) {
  .table-responsive-cards thead { display: none; }
  .table-responsive-cards tbody, .table-responsive-cards tr, .table-responsive-cards td { display: block; width: 100%; }
  .table-responsive-cards tr {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 8px;
    border: 1px solid var(--nm-line);
    border-radius: var(--nm-radius-sm);
    padding: 6px 10px;
    box-shadow: var(--nm-shadow);
  }
  /* Le premier champ (généralement l'identifiant : date, nom...) prend toute la
     largeur et sert d'en-tête visuel à la carte ; les suivants se rangent en
     grille compacte 2 colonnes pour limiter la hauteur des longs historiques. */
  .table-responsive-cards td {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
    padding: 4px 4px;
    border: none;
    flex: 1 1 50%;
    min-width: 0;
  }
  .table-responsive-cards td:first-child {
    flex-basis: 100%;
    font-size: .95rem;
    padding-bottom: 6px;
    margin-bottom: 2px;
    border-bottom: 1px dashed var(--nm-line);
  }
  .table-responsive-cards td:last-child:not(:first-child) {
    flex-basis: 100%;
  }
  .table-responsive-cards td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--nm-ink-soft);
    font-size: .66rem;
    text-transform: uppercase;
    letter-spacing: .3px;
  }
  .table-responsive-cards td.text-end { text-align: left; }
  /* Actions (boutons modifier/supprimer) : rangée pleine largeur, alignée à droite */
  .table-responsive-cards td:has(.btn) { flex-basis: 100%; flex-direction: row; justify-content: flex-end; gap: 8px; padding-top: 6px; }
  .table-responsive-cards td:has(.btn)::before { display: none; }

  .nm-row-collapsed { display: none !important; }
}

/* ---------------- Progress bars ---------------- */
.progress { border-radius: 999px; background: var(--nm-cream-2); height: 10px; }
.progress-bar-yellow { background: linear-gradient(90deg, var(--nm-yellow), var(--nm-orange)); }

/* ---------------- Section header ---------------- */
.section-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.section-header h2 { font-size: 1.15rem; font-weight: 800; margin: 0; color: var(--nm-brown); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--nm-ink-soft); }
.empty-state i { font-size: 2.6rem; color: var(--nm-yellow-dark); margin-bottom: 10px; display: block; }

/* ---------------- Responsive sidebar (mobile) ---------------- */
@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-overlay { display: block; }
  .main-area { margin-left: 0; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 14px; }
}

/* ---------------- Print (rapports) ---------------- */
@media print {
  .sidebar, .topbar, .no-print, .sidebar-overlay { display: none !important; }
  .main-area { margin-left: 0 !important; }
  body { background: #fff; }
  .page-content { padding: 0; animation: none; }
}

/* Scrollbar */
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--nm-line); border-radius: 10px; }

/* ==========================================================================
   UX terrain : salutation, actions rapides, checklist du jour,
   navigation mobile au pouce, bouton flottant de saisie.
   ========================================================================== */

/* ---------------- Salutation dashboard ---------------- */
.greeting-block { margin-bottom: 18px; }
.greeting-title { font-size: 1.45rem; font-weight: 800; color: var(--nm-brown); margin: 0; line-height: 1.2; }
.greeting-date { font-size: .85rem; color: var(--nm-ink-soft); font-weight: 600; text-transform: capitalize; }

/* ---------------- Tuiles d'action rapide ---------------- */
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
@media (max-width: 767.98px) { .quick-actions { grid-template-columns: repeat(2, 1fr); } }

.quick-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 10px 14px;
  background: #fff;
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  box-shadow: var(--nm-shadow);
  color: var(--nm-ink);
  font-weight: 700;
  font-size: .85rem;
  text-align: center;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.quick-tile:hover { transform: translateY(-3px); box-shadow: var(--nm-shadow-hover); border-color: var(--nm-yellow-dark); color: var(--nm-ink); }
.quick-tile i {
  width: 48px; height: 48px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
}
.quick-tile .qt-yellow { background: #FFF3CD; color: var(--nm-yellow-deep); }
.quick-tile .qt-green { background: #E3F7EE; color: var(--nm-green); }
.quick-tile .qt-blue { background: #E8F1FF; color: var(--nm-blue); }
.quick-tile .qt-orange { background: #FFEDE0; color: var(--nm-orange); }
.quick-tile .qt-red { background: #FDE8E8; color: var(--nm-red); }

/* ---------------- Checklist "Suivi du jour" ---------------- */
.today-check-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--nm-radius-sm);
  border: 1px solid var(--nm-line);
  margin-bottom: 8px;
  background: #fff;
  transition: background .15s ease;
}
.today-check-item.done { background: #F2FBF7; border-color: #CDEEDF; }
.today-check-item .tci-lot { font-weight: 700; font-size: .9rem; }
.today-check-item .tci-age { font-size: .74rem; color: var(--nm-ink-soft); }
.tci-status-done { color: var(--nm-green); font-size: 1.25rem; }

/* ---------------- Toast de résumé des alertes ---------------- */
.alert-toast-container {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: 1090;
  width: calc(100% - 28px);
  max-width: 420px;
}
@media (min-width: 992px) {
  .alert-toast-container { bottom: 20px; }
}
.nm-toast { border-radius: var(--nm-radius-sm); box-shadow: var(--nm-shadow-hover); }
.nm-toast .btn-close { opacity: .7; }
.nm-toast .btn-close:hover { opacity: 1; }

/* ---------------- Alertes hiérarchisées ---------------- */
.alert-item { border-left: 4px solid var(--nm-line); padding-left: 12px; }
.alert-item.critical { border-left-color: var(--nm-red); }
.alert-item.warning { border-left-color: var(--nm-yellow-dark); }
.alert-item.info { border-left-color: var(--nm-blue); }

/* Page Alertes : feed compact style notification, plutôt que de grosses
   cartes encadrées. Barre de couleur = gravité, icône ronde, lu = atténué. */
.alert-card {
  border-left: 4px solid var(--nm-line);
  transition: opacity .15s ease, transform .15s ease;
}
.alert-card.niveau-critical { border-left-color: var(--nm-red); }
.alert-card.niveau-warning { border-left-color: var(--nm-yellow-dark); }
.alert-card.niveau-info { border-left-color: var(--nm-blue); }
.alert-card.is-read { opacity: .6; }
.alert-lvl-dot {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.alert-lvl-dot.critical { background: #FDEAEA; color: var(--nm-red); }
.alert-lvl-dot.warning { background: #FFF3CD; color: var(--nm-yellow-deep); }
.alert-lvl-dot.info { background: #E8F1FF; color: var(--nm-blue); }
.alert-dot-new { width: 8px; height: 8px; border-radius: 50%; background: var(--nm-red); flex-shrink: 0; }

/* ---------------- Onboarding guidé ---------------- */
.onboarding-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 767.98px) { .onboarding-steps { grid-template-columns: 1fr; } }
.onboarding-step {
  position: relative;
  padding: 22px 18px 18px;
  background: #fff;
  border: 1px solid var(--nm-line);
  border-radius: var(--nm-radius);
  box-shadow: var(--nm-shadow);
  text-align: center;
}
.onboarding-step .step-num {
  position: absolute;
  top: -14px; left: 50%;
  transform: translateX(-50%);
  width: 28px; height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nm-yellow), var(--nm-yellow-dark));
  color: #4A2E00;
  font-weight: 800;
  font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 8px rgba(245, 166, 35, .4);
}
.onboarding-step i { font-size: 2rem; color: var(--nm-yellow-deep); margin-bottom: 8px; display: block; }
.onboarding-step h6 { font-weight: 800; font-size: .95rem; }
.onboarding-step p { font-size: .8rem; color: var(--nm-ink-soft); margin-bottom: 12px; }
.onboarding-step.step-done { opacity: .65; }
.onboarding-step.step-done .step-num { background: var(--nm-green); color: #fff; }

/* ---------------- Barre de navigation mobile (pouce) ---------------- */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff;
  border-top: 1px solid var(--nm-line);
  box-shadow: 0 -4px 16px rgba(43, 32, 6, .08);
  z-index: 1030;
}
.bottom-nav-inner { display: flex; height: 62px; }
.bnav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--nm-ink-soft);
  font-size: .62rem;
  font-weight: 700;
  border: none;
  background: transparent;
  position: relative;
}
.bnav-item i { font-size: 1.25rem; }
.bnav-item.active { color: var(--nm-yellow-deep); }
.bnav-item.active::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 26px; height: 3px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--nm-yellow), var(--nm-orange));
}
.bnav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 20px);
  background: var(--nm-red);
  color: #fff;
  font-size: .58rem;
  font-weight: 700;
  min-width: 15px; height: 15px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
}

/* Bouton central surélevé = saisie du jour */
.bnav-center {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  position: relative;
}
.bnav-center a {
  width: 52px; height: 52px;
  margin-top: -20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--nm-yellow) 0%, var(--nm-orange) 100%);
  color: #4A2E00;
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(245, 166, 35, .45);
  border: 4px solid var(--nm-cream);
  transition: transform .15s ease;
}
.bnav-center a:active { transform: scale(.92); }

@media (max-width: 991.98px) {
  .bottom-nav { display: block; }
  .page-content { padding-bottom: 96px; }
}

/* ---------------- Confort tactile mobile ---------------- */
@media (max-width: 767.98px) {
  .btn-neenam, .btn-outline-neenam { padding-top: .65rem; padding-bottom: .65rem; }
  .form-control, .form-select { min-height: 46px; font-size: 1rem; }
  /* clamp() plutôt qu'une taille fixe : les gros montants (F CFA) rétrécissent
     juste ce qu'il faut pour tenir sur une ligne au lieu de retomber sur 3. */
  .kpi-value { font-size: clamp(1.05rem, 5.2vw, 1.3rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .section-header h2 { font-size: 1.05rem; }

  /* Cartes et tuiles plus compactes : moins de scroll avant d'atteindre le
     contenu utile (demande explicite : dense mais lisible). */
  .kpi-card { padding: 13px 14px; gap: 11px; }
  .kpi-icon { width: 42px; height: 42px; font-size: 1.15rem; border-radius: 12px; }
  .kpi-label { font-size: .7rem; }
  .quick-tile { padding: 12px 8px 10px; font-size: .78rem; gap: 5px; }
  .quick-tile i { width: 38px; height: 38px; font-size: 1.1rem; border-radius: 11px; }
  .card-body { padding: 1rem !important; }
  .onboarding-step { padding: 18px 14px 14px; }
}

/* Focus clavier visible (accessibilité) */
a:focus-visible, button:focus-visible {
  outline: 3px solid rgba(245, 166, 35, .55);
  outline-offset: 2px;
  border-radius: 6px;
}

@media print { .bottom-nav { display: none !important; } }
