/* NutriPatients — Styles front-end (hors admin WordPress) */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Mono:wght@400;500&display=swap');

/* ── Variables (identiques au CSS admin pour cohérence) ──────── */
.np-front {
  --np-green:     #2d6a4f;
  --np-green-l:   #52b788;
  --np-green-xl:  #d8f3dc;
  --np-teal:      #40916c;
  --np-navy:      #1b2d3e;
  --np-slate:     #4a5568;
  --np-border:    #e2e8f0;
  --np-bg:        #f0f4f8;
  --np-white:     #ffffff;
  --np-danger:    #e53e3e;
  --np-warn:      #d69e2e;
  --np-ok:        #38a169;
  --np-shadow:    0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --np-shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --np-radius:    10px;
  --nav-h:        60px;
  font-family: 'DM Sans', sans-serif;
  box-sizing: border-box;
}
.np-front *, .np-front *::before, .np-front *::after { box-sizing: inherit; }

/* ── Reset de base — WordPress, Divi, et autres thèmes ──────── */
.np-front { background: var(--np-bg); min-height: 80vh; }

/* Neutralise les styles typographiques injectés par les thèmes */
.np-front h1, .np-front h2, .np-front h3,
.et_pb_section .np-front h1,
.et_pb_section .np-front h2,
.et_pb_section .np-front h3,
.entry-content .np-front h1,
.entry-content .np-front h2,
.entry-content .np-front h3 {
  font-family: 'DM Sans', sans-serif !important;
  border: none !important; padding: 0 !important; margin: 0 !important;
  line-height: 1.3 !important; color: var(--np-navy) !important;
  font-weight: 700 !important;
}
.np-front a { text-decoration: none !important; }
.np-front ul, .np-front ol { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.np-front p { margin: 0 0 8px !important; }

/* Divi wrappe le contenu dans .et_pb_row — on force le plein-largeur */
.et_pb_column .np-front,
.et_pb_row .np-front,
.et_pb_module .np-front {
  width: 100% !important; max-width: 100% !important;
  margin: 0 !important; padding: 0 !important;
}

/* ═══════════════════════════════════════════════
   ÉCRAN DE LOGIN
   ═══════════════════════════════════════════════ */
.np-login-wrap {
  display: flex; align-items: center; justify-content: center;
  min-height: 80vh; padding: 40px 16px;
}
.np-login-card {
  background: var(--np-white); border: 1px solid var(--np-border);
  border-radius: 16px; padding: 40px; width: 100%; max-width: 420px;
  box-shadow: var(--np-shadow-md);
}
.np-login-logo { text-align: center; margin-bottom: 32px; }
.np-login-icon { font-size: 3rem; display: block; margin-bottom: 8px; }
.np-login-title { font-size: 1.6rem; font-weight: 800; color: var(--np-navy); margin: 0; }
.np-login-sub   { font-size: .85rem; color: var(--np-slate); margin: 4px 0 0; }
.np-login-form  { display: flex; flex-direction: column; gap: 16px; }
.np-remember    { font-size: .84rem; color: var(--np-slate); }

/* ═══════════════════════════════════════════════
   LAYOUT PRINCIPAL
   ═══════════════════════════════════════════════ */
.np-app-wrap { display: flex; flex-direction: column; min-height: 80vh; }

/* ── Barre de navigation ─────────────────────────────────────── */
.np-front-nav {
  display: flex; align-items: center; gap: 0;
  background: var(--np-navy); height: var(--nav-h);
  padding: 0 24px; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.np-nav-brand a {
  color: #fff; font-size: 1.1rem; font-weight: 700;
  text-decoration: none; margin-right: 32px; white-space: nowrap;
}
.np-nav-links { display: flex; flex: 1; gap: 4px; }
.np-nav-link {
  color: rgba(255,255,255,.75); text-decoration: none;
  padding: 6px 14px; border-radius: 7px; font-size: .88rem; font-weight: 500;
  transition: .15s; white-space: nowrap;
}
.np-nav-link:hover { color: #fff; background: rgba(255,255,255,.1); }
.np-nav-active    { color: #fff !important; background: var(--np-teal) !important; }
.np-nav-user      { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.np-nav-username  { color: rgba(255,255,255,.7); font-size: .83rem; white-space: nowrap; }

/* ── Zone de contenu ─────────────────────────────────────────── */
.np-main {
  flex: 1; padding: 28px 32px 48px;
  max-width: 1400px; width: 100%; margin: 0 auto;
}

/* ═══════════════════════════════════════════════
   EN-TÊTES DE PAGE
   ═══════════════════════════════════════════════ */
.np-page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 24px;
  padding-bottom: 16px; border-bottom: 2px solid var(--np-green-xl);
}
.np-page-title {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-size: 1.5rem; font-weight: 700; color: var(--np-navy);
  margin: 0;
}
.np-front h1.np-page-title { /* standalone h1 without header div */
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 2px solid var(--np-green-xl);
}
.np-page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ═══════════════════════════════════════════════
   ALERTES
   ═══════════════════════════════════════════════ */
.np-alert {
  padding: 12px 16px; border-radius: 8px; margin-bottom: 20px;
  font-size: .9rem; font-weight: 500;
}
.np-alert-success { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }
.np-alert-error   { background: #fff5f5; border: 1px solid #feb2b2; color: #c53030; }
.np-alert-warn    { background: #fffbeb; border: 1px solid #f6e05e; color: #744210; }

/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.np-card {
  background: var(--np-white); border: 1px solid var(--np-border);
  border-radius: var(--np-radius); padding: 24px; margin-bottom: 20px;
  box-shadow: var(--np-shadow);
}
.np-card-title {
  font-size: 1rem; font-weight: 700; color: var(--np-navy);
  margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--np-border);
}
.np-rgpd-card   { border-left: 4px solid var(--np-green-l); }
.np-bilan-card  { border-left: 4px solid var(--np-teal); }

/* ═══════════════════════════════════════════════
   BOUTONS
   ═══════════════════════════════════════════════ */
.np-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 7px; font-size: .88rem;
  font-weight: 600; font-family: 'DM Sans', sans-serif;
  cursor: pointer; border: none; text-decoration: none; transition: .15s;
  line-height: 1.4; white-space: nowrap;
}
.np-btn-primary   { background: var(--np-green);  color: #fff; }
.np-btn-primary:hover { background: var(--np-teal); color: #fff; }
.np-btn-secondary { background: #edf2f7; color: var(--np-navy); }
.np-btn-secondary:hover { background: #e2e8f0; }
.np-btn-danger    { background: #fff5f5; color: var(--np-danger); border: 1px solid #fed7d7; }
.np-btn-danger:hover { background: var(--np-danger); color: #fff; }
.np-btn-warning   { background: #fffbeb; color: var(--np-warn); border: 1px solid #fef3c7; }
.np-btn-xs  { padding: 4px 10px; font-size: .78rem; }
.np-btn-sm  { padding: 6px 12px; font-size: .83rem; }
.np-btn-lg  { padding: 11px 24px; font-size: .95rem; }
.np-btn-full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════════
   FORMULAIRES
   ═══════════════════════════════════════════════ */
.np-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 200px; }
.np-field label { font-size: .82rem; font-weight: 600; color: var(--np-slate); }
.np-field input[type="text"],
.np-field input[type="email"],
.np-field input[type="tel"],
.np-field input[type="date"],
.np-field input[type="datetime-local"],
.np-field input[type="number"],
.np-field input[type="password"],
.np-field select,
.np-field textarea {
  border: 1px solid var(--np-border); border-radius: 7px;
  padding: 8px 12px; font-size: .88rem; font-family: 'DM Sans', sans-serif;
  color: var(--np-navy); background: var(--np-white); width: 100%;
  transition: border-color .15s;
}
.np-field input:focus,
.np-field select:focus,
.np-field textarea:focus {
  outline: none; border-color: var(--np-green-l);
  box-shadow: 0 0 0 3px rgba(82,183,136,.15);
}
.np-field-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.np-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.np-form-section { background: var(--np-white); border: 1px solid var(--np-border);
  border-radius: var(--np-radius); padding: 24px; }
.np-section-title { font-size: 1rem; font-weight: 700; color: var(--np-navy);
  margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--np-border); }
.np-rgpd-section { background: #f0fff4; border-color: var(--np-green-l); }
.np-form-actions { display: flex; gap: 12px; align-items: center; padding: 20px 0; }
.np-checkbox-label { display: flex; align-items: flex-start; gap: 10px;
  font-size: .88rem; color: var(--np-slate); cursor: pointer; line-height: 1.5; }
.np-checkbox-label input { margin-top: 2px; accent-color: var(--np-green); }
.np-hint { font-size: .78rem; color: var(--np-slate); margin: 4px 0 12px; }

/* ═══════════════════════════════════════════════
   TABLEAUX
   ═══════════════════════════════════════════════ */
.np-table-wrap { overflow-x: auto; margin-bottom: 20px; }
.np-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.np-table th {
  text-align: left; padding: 10px 12px; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; color: var(--np-slate);
  background: var(--np-bg); border-bottom: 2px solid var(--np-border);
  white-space: nowrap;
}
.np-table td { padding: 10px 12px; border-bottom: 1px solid var(--np-border);
  color: var(--np-navy); vertical-align: middle; }
.np-table tr:last-child td { border-bottom: none; }
.np-table tr:hover td { background: #f8faff; }
.np-empty { text-align: center; color: var(--np-slate); padding: 32px !important; font-style: italic; }
.np-actions { display: flex; gap: 6px; align-items: center; }

/* Statuts marqueurs */
.np-statut-bas td    { background: #ebf8ff; }
.np-statut-haut td   { background: #fff5f5; }
.np-statut-critique td { background: #fed7d7; }

/* ═══════════════════════════════════════════════
   BADGES
   ═══════════════════════════════════════════════ */
.np-badge {
  display: inline-block; padding: 2px 10px; border-radius: 20px;
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}
.np-badge-actif     { background: #c6f6d5; color: #276749; }
.np-badge-inactif   { background: #e2e8f0; color: #4a5568; }
.np-badge-archive   { background: #feebc8; color: #744210; }
.np-badge-normal    { background: #c6f6d5; color: #276749; }
.np-badge-bas       { background: #bee3f8; color: #2b6cb0; }
.np-badge-haut      { background: #fed7d7; color: #c53030; }
.np-badge-critique  { background: #fc8181; color: #fff; }
.np-badge-confirme  { background: #c6f6d5; color: #276749; }
.np-badge-effectue  { background: #e9d8fd; color: #553c9a; }
.np-badge-annule    { background: #e2e8f0; color: #4a5568; }
.np-badge-no_show   { background: #fed7d7; color: #c53030; }

/* ═══════════════════════════════════════════════
   CODES
   ═══════════════════════════════════════════════ */
.np-code {
  font-family: 'DM Mono', monospace; font-size: .8rem;
  background: var(--np-bg); padding: 2px 8px; border-radius: 5px;
  color: var(--np-teal); border: 1px solid var(--np-border);
}
.np-code-lg { font-size: .88rem; }

/* ═══════════════════════════════════════════════
   TOOLBAR / SEARCH
   ═══════════════════════════════════════════════ */
.np-toolbar { display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 16px; }
.np-search-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; flex: 1; }
.np-search-input { padding: 7px 12px; border: 1px solid var(--np-border);
  border-radius: 7px; font-size: .88rem; min-width: 220px; flex: 1;
  font-family: 'DM Sans', sans-serif; }
.np-search-form select { padding: 7px 10px; border: 1px solid var(--np-border);
  border-radius: 7px; font-size: .88rem; font-family: 'DM Sans', sans-serif; }
.np-total { font-size: .82rem; color: var(--np-slate); margin-left: auto; white-space: nowrap; }

/* ═══════════════════════════════════════════════
   STATS
   ═══════════════════════════════════════════════ */
.np-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px; margin-bottom: 24px; }
.np-stat-card { background: var(--np-white); border: 1px solid var(--np-border);
  border-radius: var(--np-radius); padding: 20px; text-align: center;
  box-shadow: var(--np-shadow); }
.np-stat-value { font-size: 2.2rem; font-weight: 800; color: var(--np-green); line-height: 1; }
.np-stat-label { font-size: .8rem; color: var(--np-slate); margin-top: 6px; }

/* ═══════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════ */
.np-tabs { display: flex; gap: 4px; margin-bottom: 20px;
  border-bottom: 2px solid var(--np-border); padding-bottom: 0; flex-wrap: wrap; }
.np-tab {
  padding: 10px 18px; font-size: .88rem; font-weight: 600;
  color: var(--np-slate); text-decoration: none; border-radius: 7px 7px 0 0;
  border: 1px solid transparent; border-bottom: none; margin-bottom: -2px;
  transition: .15s;
}
.np-tab:hover { color: var(--np-navy); background: var(--np-bg); }
.np-tab-active { background: var(--np-white); color: var(--np-green);
  border-color: var(--np-border); border-bottom-color: var(--np-white); }

/* ═══════════════════════════════════════════════
   DL (détail patient)
   ═══════════════════════════════════════════════ */
.np-dl { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px;
  font-size: .88rem; align-items: start; }
.np-dl dt { font-weight: 600; color: var(--np-slate); padding-top: 2px; }
.np-dl dd { color: var(--np-navy); margin: 0; }
.np-pre  { white-space: pre-wrap; font-family: inherit; }
.np-meta { font-size: .78rem; color: var(--np-slate); }

/* ═══════════════════════════════════════════════
   BILANS
   ═══════════════════════════════════════════════ */
.np-bilan-header { display: flex; align-items: center;
  justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.np-bilan-header h3 { font-size: .95rem; font-weight: 700; color: var(--np-navy);
  margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.np-bilan-notes { font-size: .85rem; color: var(--np-slate);
  background: var(--np-bg); padding: 8px 12px; border-radius: 6px; margin: 8px 0 0; }
.np-marqueur-group { margin-bottom: 10px; border: 1px solid var(--np-border);
  border-radius: 8px; overflow: hidden; }
.np-marqueur-cat { padding: 10px 14px; font-weight: 700; font-size: .88rem;
  cursor: pointer; background: var(--np-bg); color: var(--np-navy); }
.np-marqueur-grid { display: flex; flex-direction: column; gap: 0; padding: 0; }
.np-marqueur-row {
  display: grid; grid-template-columns: 1fr 100px 60px auto;
  gap: 8px; align-items: center; padding: 8px 14px;
  border-top: 1px solid var(--np-border); font-size: .85rem;
}
.np-marqueur-nom { font-weight: 500; color: var(--np-navy); }
.np-val-input { padding: 5px 8px; border: 1px solid var(--np-border);
  border-radius: 6px; font-size: .85rem; width: 100%; }
.np-unit { color: var(--np-slate); font-size: .78rem; white-space: nowrap; }
.np-ref  { color: var(--np-slate); font-size: .74rem; white-space: nowrap; }

/* ═══════════════════════════════════════════════
   AGENDA / CALENDRIER
   ═══════════════════════════════════════════════ */
.np-agenda-nav { display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 20px; }
.np-week-title { font-size: 0.95rem; font-weight: 700; color: var(--np-navy);
  flex: 1; text-align: center; margin: 0; }
.np-calendar { display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 8px; margin-bottom: 20px; }
.np-cal-col { background: var(--np-white); border: 1px solid var(--np-border);
  border-radius: 10px; overflow: hidden; min-height: 180px; }
.np-cal-today { border-color: var(--np-green-l); box-shadow: 0 0 0 2px var(--np-green-xl); }
.np-cal-header { padding: 8px 10px; text-align: center; font-size: .78rem;
  font-weight: 700; color: var(--np-slate); background: var(--np-bg);
  border-bottom: 1px solid var(--np-border); }
.np-cal-today .np-cal-header { background: var(--np-green-xl); color: var(--np-green); }
.np-cal-date { font-size: 1rem; color: var(--np-navy); font-weight: 700; }
.np-cal-events { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.np-cal-event { padding: 5px 7px; border-radius: 6px; font-size: .75rem;
  background: var(--np-green-xl); border-left: 3px solid var(--np-green); }
.np-cal-event a { color: var(--np-navy); text-decoration: none; font-weight: 600; }
.np-cal-event a:hover { color: var(--np-green); }
.np-rdv-annule  { background: #e2e8f0; border-left-color: #a0aec0; }
.np-rdv-effectue { background: #e9d8fd; border-left-color: #9f7aea; }
.np-rdv-no_show  { background: #fff5f5; border-left-color: var(--np-danger); }
.np-event-time  { font-weight: 700; color: var(--np-teal); }
.np-event-type  { color: var(--np-slate); margin-top: 2px; }
.np-cal-empty   { min-height: 40px; }

/* ═══════════════════════════════════════════════
   PAGINATION
   ═══════════════════════════════════════════════ */
.np-pagination { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 16px; }
.np-page-link { display: inline-block; padding: 6px 12px; border-radius: 6px;
  border: 1px solid var(--np-border); font-size: .83rem; text-decoration: none;
  color: var(--np-navy); transition: .15s; }
.np-page-link:hover { background: var(--np-green-xl); border-color: var(--np-green-l); }
.np-page-current { background: var(--np-green); color: #fff; border-color: var(--np-green); }

/* ═══════════════════════════════════════════════
   RGPD
   ═══════════════════════════════════════════════ */
.np-rgpd-ok   { color: var(--np-ok); font-weight: 600; font-size: .9rem; margin: 0; }
.np-rgpd-warn { color: var(--np-warn); font-weight: 600; font-size: .9rem; margin: 0; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .np-calendar { grid-template-columns: repeat(4, 1fr); }
  .np-form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .np-main { padding: 16px; }
  .np-front-nav { padding: 0 12px; gap: 4px; }
  .np-nav-brand a { margin-right: 12px; font-size: .95rem; }
  .np-nav-links { gap: 2px; }
  .np-nav-link { padding: 5px 8px; font-size: .8rem; }
  .np-calendar { grid-template-columns: repeat(2, 1fr); }
  .np-dl { grid-template-columns: 1fr; }
  .np-dl dt { margin-bottom: 0; }
  .np-marqueur-row { grid-template-columns: 1fr 80px; }
  .np-unit, .np-ref { display: none; }
  .np-page-title { font-size: 1.2rem; }
}
@media (max-width: 480px) {
  .np-calendar { grid-template-columns: 1fr; }
  .np-nav-username { display: none; }
}

/* ═══════════════════════════════════════════════
   NOTES DE CONSULTATION
   ═══════════════════════════════════════════════ */
.np-notes-list { display: flex; flex-direction: column; gap: 16px; }

.np-note-card {
  border-left: 4px solid var(--np-green-l);
  padding: 20px 24px;
}
.np-note-confidential-card {
  border-left-color: var(--np-warn);
  background: #fffbeb;
}

.np-note-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.np-note-meta {
  display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap;
}
.np-note-date   { font-weight: 700; color: var(--np-navy); font-size: .88rem; }
.np-note-auteur { font-size: .78rem; color: var(--np-slate); }
.np-note-actions { display: flex; gap: 6px; flex-shrink: 0; }

.np-badge-type-note    { background: var(--np-green-xl); color: var(--np-green); }
.np-badge-confidentiel { background: #fef3c7; color: #92400e; }

.np-note-body {
  font-size: .9rem; line-height: 1.7; color: var(--np-navy);
  white-space: pre-wrap; background: var(--np-bg);
  padding: 14px 16px; border-radius: 7px;
  border: 1px solid var(--np-border);
}

.np-note-form-card textarea {
  font-family: 'DM Sans', sans-serif;
  line-height: 1.6; resize: vertical; min-height: 140px;
}
.np-note-confidential {
  margin: 8px 0 4px;
  font-size: .85rem; color: var(--np-slate);
}
.np-field-rdv-link { min-width: 240px; }

/* ═══════════════════════════════════════════════
   RATIOS CALCULÉS AUTOMATIQUEMENT
   ═══════════════════════════════════════════════ */
.np-marqueur-auto {
  background: linear-gradient(to right, #f0fff4, #f8fafc);
  border-left: 3px solid var(--np-green-l);
}
.np-val-auto {
  background: var(--np-bg) !important;
  font-family: 'DM Mono', monospace !important;
  font-weight: 700 !important;
  cursor: default !important;
  border-style: dashed !important;
}
.np-auto-formula {
  font-size: .72rem !important;
  color: var(--np-slate);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.np-badge-auto {
  font-size: .7rem; background: var(--np-green-xl);
  color: var(--np-green); margin-left: 8px;
  padding: 2px 8px; border-radius: 20px; font-weight: 600;
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════
   IMC — AFFICHAGE
   ═══════════════════════════════════════════════ */
.np-imc-display {
  padding: 8px 12px; border-radius: 7px; font-size: .85rem;
  font-weight: 700; border: 1px solid var(--np-border);
  background: var(--np-bg); color: var(--np-slate);
  min-height: 38px; display: flex; align-items: center;
  transition: .2s;
}
.np-imc-ok      { background: #f0fff4; color: #276749; border-color: #9ae6b4; }
.np-imc-warn    { background: #fffbeb; color: #744210; border-color: #f6e05e; }
.np-imc-danger  { background: #fff5f5; color: #c53030; border-color: #feb2b2; }

/* ═══════════════════════════════════════════════
   FORMULAIRE PATIENT ÉTENDU
   ═══════════════════════════════════════════════ */
.np-form-section {
  background: var(--np-white); border: 1px solid var(--np-border);
  border-radius: var(--np-radius); padding: 24px;
  margin-bottom: 16px;
}
.np-form-section-full { grid-column: 1 / -1; }
.np-form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.np-field-sm  { flex: 0 1 120px !important; min-width: 100px; }
.np-field-lg  { flex: 2 1 300px !important; }
.np-field-required label::after { content: ' *'; color: var(--np-danger); }

/* ═══════════════════════════════════════════════
   COURBES DE SUIVI
   ═══════════════════════════════════════════════ */
.np-charts-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  margin-top: 8px;
}
.np-chart-wrap {
  position: relative; min-height: 220px;
}
.np-mesures-table th, .np-mesures-table td { font-size: .8rem; padding: 7px 8px; }

@media (max-width: 768px) {
  .np-charts-grid { grid-template-columns: 1fr; }
  .np-form-2col   { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════
   BOUTONS IA
   ═══════════════════════════════════════════════ */
.np-btn-ia {
  background: linear-gradient(135deg, #6b21a8, #4f46e5);
  color: #fff; border: none;
}
.np-btn-ia:hover { background: linear-gradient(135deg, #7c3aed, #4338ca); color: #fff; }

/* ═══════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════ */
.np-modal {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.55); backdrop-filter: blur(2px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.np-modal-box {
  background: var(--np-white); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
  max-height: 90vh; width: 100%;
  animation: np-modal-in .2s ease;
}
.np-modal-lg  { max-width: 900px; }
.np-modal-xl  { max-width: 1100px; }

@keyframes np-modal-in {
  from { opacity:0; transform: scale(.96) translateY(8px); }
  to   { opacity:1; transform: scale(1)  translateY(0); }
}
.np-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--np-border);
  flex-shrink: 0;
}
.np-modal-header h3 { font-size: 1rem; font-weight: 700; color: var(--np-navy); margin: 0; }
.np-modal-close {
  background: none; border: none; font-size: 1.1rem; cursor: pointer;
  color: var(--np-slate); padding: 4px 8px; border-radius: 6px;
  transition: .15s; line-height: 1;
}
.np-modal-close:hover { background: var(--np-bg); color: var(--np-navy); }
.np-modal-body {
  padding: 20px 24px; overflow-y: auto; flex: 1;
}

/* ═══════════════════════════════════════════════
   SPINNER IA
   ═══════════════════════════════════════════════ */
.np-ia-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 48px 24px; gap: 16px; text-align: center;
  color: var(--np-slate);
}
.np-ia-spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid var(--np-border);
  border-top-color: #6b21a8;
  animation: np-spin 1s linear infinite;
}
@keyframes np-spin { to { transform: rotate(360deg); } }
.np-ia-meta {
  background: var(--np-green-xl); color: var(--np-green);
  padding: 8px 14px; border-radius: 7px; font-size: .85rem;
  margin-bottom: 12px; font-weight: 600;
}

/* ═══════════════════════════════════════════════
   TABLEAU D'EXTRACTION
   ═══════════════════════════════════════════════ */
.np-table-extract input[type="text"] {
  border: 1px solid var(--np-border); border-radius: 5px;
  padding: 3px 6px; font-size: .8rem; font-family: 'DM Sans', sans-serif;
}
.np-table-extract input[type="text"]:focus {
  outline: none; border-color: var(--np-green-l);
  box-shadow: 0 0 0 2px rgba(82,183,136,.15);
}

/* ═══════════════════════════════════════════════
   RAPPORT IA
   ═══════════════════════════════════════════════ */
.np-rapport-ia { font-size: .9rem; line-height: 1.7; }
.np-rapport-ia h2 {
  color: var(--np-green); font-size: 1.05rem; font-weight: 700;
  border-bottom: 2px solid var(--np-green-xl);
  padding-bottom: 6px; margin: 24px 0 12px !important;
}
.np-rapport-ia h3 {
  color: var(--np-navy); font-size: .95rem; font-weight: 700;
  margin: 16px 0 8px !important;
}
.np-rapport-ia ul { list-style: disc; padding-left: 20px; }
.np-rapport-ia li { margin-bottom: 4px; }
.np-rapport-section { margin-bottom: 20px; }

/* ═══════════════════════════════════════════════
   TABLEAU COMPARATIF DES BILANS
   ═══════════════════════════════════════════════ */
.np-bilans-pivot { font-size: .82rem; }
.np-bilans-pivot th { font-size: .75rem; text-align: center; white-space: nowrap; }
.np-bilans-pivot td { text-align: center; vertical-align: middle; }

/* Colonne marqueur alignée à gauche */
.np-marqueur-col { text-align: left !important; min-width: 160px; }
.np-unit-col,
.np-ref-col      { text-align: center; color: var(--np-slate); min-width: 60px; }

/* Colonne dernier bilan surlignée */
.np-col-last { background: rgba(45,106,79,.05) !important; border-left: 2px solid var(--np-green-l) !important; }

/* Ligne de catégorie */
.np-pivot-cat-row td { background: var(--np-bg) !important; }
.np-pivot-cat {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--np-slate); text-align: left !important;
  padding: 6px 12px !important;
}

/* Valeurs hors normes */
.np-val-num   { font-weight: 600; }
.np-val-haut  { color: var(--np-danger) !important; }
.np-val-bas   { color: #2b6cb0 !important; }
.np-statut-haut td { background: rgba(229,62,62,.06); }
.np-statut-bas  td { background: rgba(43,108,176,.06); }
.np-statut-icon { font-size: .7rem; margin-left: 2px; }

/* Tendances */
.np-trend-col { min-width: 70px; }
.np-trend {
  display: inline-flex; align-items: center; gap: 3px;
  font-weight: 700; font-size: .9rem;
}
.np-trend small { font-size: .65rem; font-weight: 400; opacity: .8; }
.np-trend-up     { color: var(--np-danger); }
.np-trend-down   { color: #2b6cb0; }
.np-trend-stable { color: var(--np-slate); }

/* Responsive : scroll horizontal */
.np-bilans-pivot { min-width: 600px; }

/* ═══════════════════════════════════════════════
   TABLEAU COMPARATIF DES BILANS — DESIGN MODERNE
   ═══════════════════════════════════════════════ */

.np-bilans-comparatif { padding: 0; overflow: hidden; }

.np-bilans-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; padding: 20px 24px 12px;
  border-bottom: 1px solid var(--np-border);
}
.np-bilans-actions { display: flex; gap: 8px; }

/* Légende */
.np-bilans-legende {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 24px; background: var(--np-bg);
  border-bottom: 1px solid var(--np-border); font-size: .78rem;
}
.np-leg-item  { display: flex; align-items: center; gap: 5px; color: var(--np-slate); }
.np-leg-sep   { color: var(--np-border); }
.np-leg-dot   { width: 10px; height: 10px; border-radius: 50%; }
.np-leg-normal { background: #c6f6d5; }
.np-leg-haut   { background: #fed7d7; }
.np-leg-bas    { background: #bee3f8; }
.np-trend-icon { font-weight: 800; font-size: .9rem; }
.np-trend-icon.np-trend-up     { color: #c53030; }
.np-trend-icon.np-trend-down   { color: #2b6cb0; }
.np-trend-icon.np-trend-stable { color: var(--np-slate); }

/* Tableau pivot */
.np-bilans-pivot {
  font-size: .82rem; border-collapse: separate; border-spacing: 0;
  min-width: 600px;
}

/* En-têtes */
.np-pivot-head th {
  background: var(--np-navy); color: #fff;
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em;
  padding: 10px 12px; white-space: nowrap;
  border-right: 1px solid rgba(255,255,255,.1);
  position: sticky; top: 0; z-index: 2;
}
.np-pivot-head th:last-child { border-right: none; }

/* Colonne dernier bilan */
.np-col-dernier {
  background: rgba(45,106,79,.08) !important;
  border-left: 2px solid var(--np-green-l) !important;
  border-right: 2px solid var(--np-green-l) !important;
}
.np-pivot-head .np-col-dernier { background: var(--np-green) !important; }

.np-bilan-date { font-weight: 700; font-size: .8rem; }
.np-bilan-labo { font-size: .68rem; opacity: .8; margin-top: 2px; }
.np-bilan-tag  {
  display: inline-block; margin-top: 4px;
  background: rgba(255,255,255,.25); color: #fff;
  font-size: .65rem; padding: 1px 7px; border-radius: 20px;
  font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
}

/* Colonnes fixes */
.np-col-marqueur { text-align: left !important; min-width: 150px; max-width: 200px; padding-left: 14px !important; }
.np-col-unit, .np-col-ref { text-align: center; color: var(--np-slate); min-width: 55px; font-size: .75rem; }
.np-col-val  { text-align: center; min-width: 75px; }
.np-col-trend { text-align: center; min-width: 75px; }

/* Ligne catégorie */
.np-pivot-cat-row td {
  background: linear-gradient(to right, var(--np-green-xl), var(--np-bg)) !important;
  padding: 7px 14px !important;
}
.np-pivot-cat {
  font-size: .72rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: .08em; color: var(--np-green); text-align: left !important;
}
.np-cat-count { font-weight: 400; opacity: .7; margin-left: 4px; }

/* Lignes de données */
.np-pivot-row { transition: background .1s; }
.np-pivot-row:hover td { background: #f0f7ff !important; }
.np-pivot-row td {
  padding: 8px 10px; border-bottom: 1px solid var(--np-border);
  vertical-align: middle;
}

.np-marqueur-label { font-weight: 600; color: var(--np-navy); }

/* Cellules valeurs */
.np-cell-val    { font-weight: 700; font-size: .9rem; color: var(--np-navy); }
.np-cell-empty  { color: #cbd5e0; font-size: .85rem; }

/* Statuts */
.np-cell-haut     { background: rgba(254,202,202,.55) !important; }
.np-cell-bas      { background: rgba(191,219,254,.45) !important; }
.np-cell-critique { background: rgba(252,165,165,.7)  !important; }
.np-cell-haut .np-cell-val     { color: #991b1b; font-weight: 600; }
.np-cell-bas .np-cell-val      { color: #1e3a8a; font-weight: 600; }
.np-cell-critique .np-cell-val { color: #7f1d1d; font-weight: 700; }

/* Tendances */
.np-trend-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 8px; border-radius: 20px; font-weight: 800; font-size: .85rem;
}
.np-trend-chip small { font-size: .65rem; font-weight: 500; opacity: .85; }
.np-trend-up     { background: #fff5f5; color: #c53030; }
.np-trend-down   { background: #ebf8ff; color: #2b6cb0; }
.np-trend-stable { background: #f7fafc; color: #718096; }

@media (max-width: 768px) {
  .np-bilans-pivot { font-size: .75rem; }
  .np-col-marqueur { min-width: 110px; }
}

/* ── Recherche alimentaire ─────────────────────────────────── */
#np-aliment-search-results li {
    padding: 10px 14px; cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex; align-items: center; gap: 10px;
}
#np-aliment-search-results li:hover { background: #f7faf7; }
#np-aliment-search-results li strong { flex: 1; font-size: 13px; color: #1a2e1c; }
#np-aliment-search-results .np-as-group { font-size: 11px; color: #999; }
#np-aliment-search-results .np-as-kcal { font-size: 12px; color: #2c5530; font-weight: 600; min-width: 60px; text-align: right; }
#np-aliment-search-results .np-as-empty { color: #999; font-style: italic; cursor: default !important; }
.np-as-detail-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.np-as-detail-table td { padding: 5px 10px 5px 0; border-bottom: 1px solid #e8f0e9; }
.np-as-detail-table td:first-child { color: #6b7c6d; width: 120px; }
.np-as-detail-table td:last-child { font-weight: 600; color: #1a2e1c; }

/* ── Bouton partage patient ─────────────────────────────────────────── */
.np-btn-sage-active {
  background: #52b788 !important;
  color: white !important;
  border-color: #52b788 !important;
  font-weight: 600;
}
.np-btn-sage-active:hover {
  background: #40916c !important;
}

/* ════════ NutriCabinet — Onglet Gestion du site ════════ */
/* ════════════════════════════════════════════════════════════════
   NutriPatient — Onglet « Gestion du site »
   À concaténer dans front.css, ou enqueue séparément.
   ════════════════════════════════════════════════════════════════ */

/* Header de page avec boutons à droite */
.np-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.np-page-subtitle {
  color: #718096;
  margin: 4px 0 0;
  font-size: 0.95rem;
}

/* Alerts */
.np-alert {
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.95rem;
}
.np-alert-success {
  background: #d8f3dc;
  border-left: 4px solid #2d6a4f;
  color: #1b4332;
}
.np-alert-info {
  background: #e6f3ff;
  border-left: 4px solid #2196f3;
  color: #0d47a1;
}

/* Onglets internes */
.np-cabinet-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
}
.np-cabinet-tab {
  padding: 8px 14px;
  border-radius: 6px;
  color: #4a5568;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background .15s, color .15s;
}
.np-cabinet-tab:hover {
  background: #f8fafc;
  color: #2d6a4f;
  text-decoration: none;
}
.np-cabinet-tab.active {
  background: #2d6a4f;
  color: #fff;
}
.np-cabinet-tab.active:hover {
  background: #1b4332;
  color: #fff;
}

.np-cabinet-desc {
  background: #f0f6fc;
  border-left: 3px solid #72aee6;
  padding: 10px 14px;
  font-size: 0.88rem;
  color: #4a5568;
  border-radius: 0 6px 6px 0;
  margin-bottom: 24px;
  font-style: italic;
}

/* Formulaire d'édition des options */
.np-cabinet-form {
  background: #fff;
  border-radius: 10px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.np-cabinet-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.np-cabinet-field {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}
.np-cabinet-field:last-child { border-bottom: none; padding-bottom: 0; }
.np-cabinet-label {
  font-weight: 600;
  color: #1b2d3e;
  font-size: 0.92rem;
  padding-top: 8px;
}
.np-cabinet-control input[type="text"],
.np-cabinet-control input[type="url"],
.np-cabinet-control input[type="email"],
.np-cabinet-control input[type="number"],
.np-cabinet-control select,
.np-cabinet-control textarea {
  width: 100%;
  max-width: 500px;
  padding: 9px 12px;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.np-cabinet-control input:focus,
.np-cabinet-control textarea:focus,
.np-cabinet-control select:focus {
  border-color: #2d6a4f;
  box-shadow: 0 0 0 3px rgba(45,106,79,0.1);
  outline: none;
}
.np-cabinet-control textarea {
  min-height: 90px;
  resize: vertical;
}

/* Toggle boolean (switch style) */
.np-cabinet-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.np-cabinet-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.np-cabinet-toggle-slider {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #cbd5e0;
  border-radius: 12px;
  transition: background .2s;
}
.np-cabinet-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .2s;
}
.np-cabinet-toggle input:checked + .np-cabinet-toggle-slider {
  background: #2d6a4f;
}
.np-cabinet-toggle input:checked + .np-cabinet-toggle-slider::before {
  transform: translateX(20px);
}
.np-cabinet-toggle-label {
  font-size: 0.92rem;
  color: #4a5568;
}

/* Sélecteur de couleur */
.np-cabinet-color {
  display: flex;
  gap: 8px;
  align-items: center;
}
.np-cabinet-color input[type="color"] {
  width: 44px; height: 40px;
  padding: 0;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  cursor: pointer;
  background: transparent;
}
.np-cabinet-color-hex {
  font-family: Menlo, Consolas, monospace;
  max-width: 110px !important;
  text-transform: uppercase;
  background: #f8fafc !important;
  font-size: 0.85rem !important;
}

/* Image preview */
.np-cabinet-image-preview {
  display: inline-block;
  vertical-align: middle;
  max-height: 40px;
  margin-left: 12px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
.np-cabinet-hint {
  color: #718096;
  font-size: 0.82rem;
  margin: 6px 0 0;
}
.np-cabinet-hint a { color: #2d6a4f; }

/* Actions en bas de formulaire */
.np-cabinet-actions {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── Onglet Contenus (cartes cliquables) ──────────────────── */
.np-cabinet-contenus {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.np-cabinet-content-card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid #edf2f7;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.np-cabinet-content-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.np-cabinet-content-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.np-cabinet-content-icon {
  font-size: 2rem;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  background: #d8f3dc;
  border-radius: 10px;
}
.np-cabinet-content-head h3 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  color: #1b2d3e;
}
.np-cabinet-content-head p {
  margin: 0;
  color: #718096;
  font-size: 0.85rem;
}
.np-cabinet-content-count {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2d6a4f;
  min-width: 40px;
  text-align: right;
}
.np-cabinet-content-actions {
  display: flex;
  gap: 8px;
}
.np-cabinet-content-actions .np-btn {
  flex: 1;
  text-align: center;
}

.np-cabinet-info {
  background: #fff8e1;
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 0 8px 8px 0;
  font-size: 0.88rem;
  color: #78350f;
}
.np-cabinet-info p { margin: 0; }

/* ── Responsive mobile ────────────────────────────────────── */
@media (max-width: 720px) {
  .np-cabinet-field {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .np-cabinet-label { padding-top: 0; }
  .np-cabinet-control input[type="text"],
  .np-cabinet-control input[type="url"],
  .np-cabinet-control input[type="email"],
  .np-cabinet-control select,
  .np-cabinet-control textarea { max-width: 100%; }
  .np-page-header { flex-direction: column; align-items: stretch; }
  .np-cabinet-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .np-cabinet-tab { white-space: nowrap; }
}
