/* ═══════════════════════════════════════════════════════════
   note-rapide.css — Modale Note rapide universelle
   Prefixe : .nr-*
   ═══════════════════════════════════════════════════════════ */

/* Pill sidebar — compacte, en bas avant le footer */
.sb-note-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  margin: 4px 12px 6px;
  background: var(--green-soft, rgba(47,191,122,.08));
  color: var(--green-dark, #0D6B35);
  border: 1.5px solid rgba(47,191,122,.25);
  border-radius: 100px;
  font-size: 11px; font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  font-family: inherit;
  transition: all .15s;
}
.sb-note-btn:hover { background: var(--green); color: #fff; border-color: var(--green); }
.sb-note-btn:hover .kbd { background: rgba(255,255,255,.2); color: #fff; }
.sb-note-btn:hover .nr-hole-letter { color: #fff; }
.sb-note-btn .plus { font-size: 14px; font-weight: 900; line-height: 1; }
.sb-note-btn .kbd {
  margin-left: auto;
  font-size: 9px; padding: 2px 5px;
  background: rgba(47,191,122,.1); border-radius: 4px;
  font-family: monospace; font-weight: 700;
  color: var(--green-dark);
}

/* Sidebar collapsed — N pulsant centré */
#app.sidebar-hidden #sidebar .sb-note-btn {
  background: transparent; box-shadow: none;
  display: flex; justify-content: center; align-items: center;
  padding: 6px 0 6px 6px; margin: 60px 0 0;
  width: 100%; height: auto; border-radius: 0;
  font-size: 0; color: transparent;
}
#app.sidebar-hidden #sidebar .sb-note-btn .plus,
#app.sidebar-hidden #sidebar .sb-note-btn .kbd { display: none; }
#app.sidebar-hidden #sidebar .sb-note-btn #nr-health-dot { display: none; }
#app.sidebar-hidden #sidebar .sb-note-btn .nr-hole {
  display: flex; align-items: center; justify-content: center;
  position: relative; width: 28px; height: 28px;
}
.nr-hole { display: none; }
.nr-hole-letter {
  position: relative; z-index: 2;
  font-size: 13px; font-weight: 900; color: var(--green);
  line-height: 1;
}
.nr-hole-letter::after {
  content: '+'; font-size: 9px; vertical-align: super; margin-left: 1px;
}
.nr-hole i {
  display: block; position: absolute;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1.5px solid var(--green);
  opacity: 0;
  animation: nr-ripple 3s linear infinite;
}
.nr-hole i:nth-child(2) { animation-delay: .5s; }
.nr-hole i:nth-child(3) { animation-delay: 1s; }
.nr-hole i:nth-child(4) { animation-delay: 1.5s; }
.nr-hole i:nth-child(5) { animation-delay: 2s; }
.nr-hole i:nth-child(6) { animation-delay: 2.5s; }

@keyframes nr-ripple {
  0% { transform: scale(.6); opacity: 0; box-shadow: 0 0 8px rgba(47,191,122,.3); }
  50% { transform: scale(1); opacity: .8; box-shadow: 0 0 14px rgba(47,191,122,.4); }
  100% { transform: scale(1.6); opacity: 0; box-shadow: 0 0 0 rgba(47,191,122,0); }
}
#app.sidebar-hidden #sidebar .sb-note-btn:hover { background: transparent; transform: none; }

/* Sidebar collapsed + hover — pill complète */
#app.sidebar-hidden #sidebar:hover .sb-note-btn {
  background: var(--green); box-shadow: 0 4px 14px rgba(47,191,122,.35);
  justify-content: flex-start; padding: 11px 14px; margin: 8px 12px 4px;
  border-radius: 100px; font-size: 12px; color: #fff;
}
#app.sidebar-hidden #sidebar:hover .sb-note-btn .plus,
#app.sidebar-hidden #sidebar:hover .sb-note-btn .kbd { display: inline; }
#app.sidebar-hidden #sidebar:hover .sb-note-btn:hover { background: var(--green2); transform: translateY(-1px); }

/* Overlay */
.nr-overlay {
  position: fixed; inset: 0;
  background: rgba(13,27,15,.55);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  z-index: 9999; padding: 32px;
  opacity: 0; transition: opacity .2s;
}
.nr-overlay.open { display: flex; opacity: 1; }

/* Modale */
.nr-modal {
  background: var(--card, #fff); width: 100%; max-width: 520px;
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(13,27,15,.12);
  overflow: hidden; display: flex; flex-direction: column;
  transform: scale(.95); transition: transform .25s cubic-bezier(.16,1,.3,1);
}
.nr-overlay.open .nr-modal { transform: scale(1); }

/* Header */
.nr-head {
  padding: 16px 22px;
  background: rgba(47,191,122,.06);
  border-bottom: 1px solid var(--border, #ccc);
  display: flex; align-items: center; gap: 12px;
}
.nr-mark { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nr-mark::before { content: ""; width: 5px; height: 28px; background: var(--green); border-radius: 2px; }
.nr-mark svg { display: block; height: 28px; }
.nr-head-l { flex: 1; }
.nr-eyebrow {
  font-size: 9px; font-weight: 900; color: var(--green-dark, #0D6B35);
  letter-spacing: .08em; text-transform: uppercase;
}
.nr-title { font-size: 15px; font-weight: 900; color: var(--text); margin-top: 2px; }
.nr-kbd {
  font-size: 10px; padding: 3px 8px;
  background: rgba(47,191,122,.10); border: 1px solid rgba(47,191,122,.30);
  border-radius: 6px; font-family: monospace; font-weight: 700;
  color: var(--green-dark, #0D6B35);
}
.nr-close {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  background: var(--card, #fff); border: 1px solid var(--border, #ccc);
  color: var(--text2); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px;
}
.nr-close:hover { background: rgba(47,191,122,.10); color: var(--green-dark); }

/* Body */
.nr-body { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; }

/* Section header */
.nr-section-h {
  font-size: 10px; font-weight: 900; color: var(--text2);
  letter-spacing: .06em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}

/* Niveau 1 — chip devis auto */
.nr-devis-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  background: rgba(47,191,122,.08); border: 1.5px solid rgba(47,191,122,.30);
  border-radius: 12px;
}
.nr-devis-chip .auto {
  font-size: 9px; font-weight: 900; color: var(--green-dark);
  background: var(--card); padding: 2px 8px; border-radius: 100px;
  letter-spacing: .04em;
}
.nr-devis-chip-name { flex: 1; font-size: 13px; font-weight: 900; color: var(--text); }
.nr-devis-chip-name small { font-weight: 400; color: var(--text2); font-size: 11px; }
.nr-devis-chip-change {
  font-size: 11px; color: var(--green-dark); font-weight: 700;
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  border-radius: 6px;
}
.nr-devis-chip-change:hover { background: var(--card); }

/* Niveau 2 — recherche */
.nr-search {
  width: 100%; padding: 11px 14px;
  background: var(--card); border: 1.5px solid var(--border, #ccc);
  border-radius: 12px;
  font-family: inherit; font-size: 13px; color: var(--text);
  transition: all .15s;
}
.nr-search:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,191,122,.25); }
.nr-search::placeholder { color: var(--muted); }

.nr-search-results {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; max-height: 200px; overflow-y: auto;
  display: none;
}
.nr-search-results.open { display: block; }
.nr-search-result {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.nr-search-result:last-child { border-bottom: none; }
.nr-search-result:hover { background: rgba(47,191,122,.08); }
.nr-sr-name { flex: 1; font-size: 12px; font-weight: 700; color: var(--text); }
.nr-sr-name small { font-weight: 400; color: var(--muted); }
/* F.4 — lignes de création (recherche sans résultat) */
.nr-sr-create .nr-sr-name { color: var(--green); }
.nr-sr-group {
  padding: 5px 12px 3px;
  font-size: 9px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--bg, #EFF4EF);
  border-bottom: 1px solid var(--border);
}

/* Detected banner */
.nr-detected-banner {
  padding: 8px 12px;
  background: rgba(237,250,243,.85); border: 1px solid rgba(47,191,122,.30);
  border-radius: 12px;
  font-size: 11px; color: var(--text2);
  display: none; align-items: center; gap: 8px;
}
.nr-detected-banner.visible { display: flex; }
.nr-detected-banner em { color: var(--green-dark); font-weight: 700; font-style: normal; }
.nr-detected-icon { color: var(--green-dark); flex-shrink: 0; }

/* Bloc compose : waveform + textarea dans un seul cadre */
.nr-compose {
  border: 1.5px solid var(--border, #ccc);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card, #fff);
  transition: border-color .2s;
}
.nr-compose:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(47,191,122,.12); }

/* Zone waveform — bouton cliquable */
.nr-wave-btn {
  position: relative;
  width: 100%; height: 64px;
  background: rgba(47,191,122,.03);
  border: none; border-bottom: 1px solid var(--border, #ccc);
  cursor: pointer; font-family: inherit;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  transition: all .25s;
}
.nr-wave-btn:hover { background: rgba(47,191,122,.06); }

/* Barres waveform — idle : ondulation franche */
.nr-wave-bars {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 2px; padding: 0 16px;
}
.nr-bar {
  width: 3px; border-radius: 3px;
  background: var(--green);
  opacity: .5;
  height: 10px;
  animation: nr-idle-wave 2s ease-in-out infinite;
}
@keyframes nr-idle-wave {
  0%, 100% { height: 6px; opacity: .3; }
  50% { height: 28px; opacity: .6; }
}

/* Recording — barres rouges réactives au volume */
.nr-wave-btn.recording { background: rgba(224,32,32,.03); border-bottom-color: var(--red, #E02020); }
.nr-wave-btn.recording .nr-bar {
  animation: none;
  opacity: .8;
  background: var(--red, #E02020);
  transition: height .05s ease-out;
}

/* Transcribing — pulse vert */
.nr-wave-btn.transcribing { background: rgba(47,191,122,.04); border-bottom-color: var(--green); }
.nr-wave-btn.transcribing .nr-bar {
  background: var(--green); opacity: .35;
  animation: nr-transcribe-pulse 1.4s ease-in-out infinite;
}
@keyframes nr-transcribe-pulse {
  0%, 100% { height: 4px; opacity: .2; }
  50% { height: 16px; opacity: .45; }
}

/* Label flottant */
.nr-wave-label {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--green-dark, #0D6B35);
  background: rgba(255,255,255,.7);
  padding: 6px 18px; border-radius: 100px;
  backdrop-filter: blur(8px);
  transition: all .2s;
}
.nr-wave-label svg { color: var(--green); flex-shrink: 0; }
.nr-wave-btn:hover .nr-wave-label { background: rgba(255,255,255,.9); transform: scale(1.02); }
.nr-wave-btn.recording .nr-wave-label { background: rgba(255,255,255,.85); color: var(--red, #E02020); }
.nr-wave-btn.recording .nr-wave-label svg { color: var(--red, #E02020); }
.nr-wave-btn.transcribing .nr-wave-label { color: var(--green-dark); }

/* Textarea — fusionnée dans le bloc compose */
.nr-textarea {
  width: 100%; min-height: 80px;
  padding: 14px 16px;
  background: transparent; border: none;
  font-family: inherit; font-size: 13px; color: var(--text);
  resize: vertical; line-height: 1.6;
}
.nr-textarea:focus { outline: none; }
.nr-textarea::placeholder { color: var(--muted); }

/* Footer */
.nr-foot {
  padding: 14px 22px;
  background: rgba(47,191,122,.04);
  border-top: 1px solid var(--border);
  display: flex; gap: 10px; align-items: center;
}
.nr-foot-info {
  flex: 1; font-size: 11px; color: var(--muted);
  font-style: italic;
}
.nr-btn-cancel {
  padding: 10px 18px; border-radius: 12px;
  background: var(--card); color: var(--text2);
  border: 1.5px solid var(--border);
  font-family: inherit; font-size: 13px; font-weight: 800;
  cursor: pointer; transition: all .15s;
}
.nr-btn-cancel:hover { background: var(--bg); }
.nr-btn-save {
  padding: 10px 22px; border-radius: 12px;
  background: var(--green); color: #fff;
  border: 1.5px solid var(--green);
  font-family: inherit; font-size: 13px; font-weight: 900;
  cursor: pointer; transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 2px 8px rgba(47,191,122,.30);
}
.nr-btn-save:hover { background: var(--green2); transform: translateY(-1px); }
.nr-btn-save:disabled {
  background: var(--muted2, #B8CEB8); border-color: var(--muted2, #B8CEB8);
  cursor: not-allowed; box-shadow: none; transform: none;
}

/* ─── ACTIONS PROPOSAL — bloc suggestions Haiku (atelier signature V3) ─── */
.nr-actions-proposal {
  padding: 20px;
  background: var(--soma-card, #FFFFFF);
  border-radius: var(--soma-r-lg, 22px);
  border: 1px solid var(--soma-border, #E8ECE5);
}
.nr-actions-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Lato', sans-serif;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--green-dark, #0D6B35);
  margin-bottom: 8px;
}
.nr-actions-eyebrow svg { flex-shrink: 0; }
.nr-actions-help {
  font-size: 13px;
  color: var(--soma-muted, #7A9480);
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  margin-bottom: 16px;
}
.nr-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.nr-action-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(47, 191, 122, .04);
  border: 1px solid rgba(47, 191, 122, .12);
  border-radius: var(--soma-r-md, 12px);
  transition: all .15s;
}
.nr-action-item:hover {
  background: rgba(47, 191, 122, .08);
  border-color: rgba(47, 191, 122, .25);
}
/* Ligne cliquable (case + libellé + priorité) */
.nr-action-main {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
/* F.2-bis — édition inline d'une carte RDV (date / heure / lieu) */
.nr-rdv-edit {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-left: 28px;
}
.nr-rdv-date, .nr-rdv-heure, .nr-rdv-lieu {
  padding: 6px 10px;
  background: var(--card);
  border: 1.5px solid var(--border, #ccc);
  border-radius: 12px;
  font-family: inherit; font-size: 12px; color: var(--text);
  transition: all .15s;
}
.nr-rdv-lieu { flex: 1; min-width: 120px; }
.nr-rdv-date:focus, .nr-rdv-heure:focus, .nr-rdv-lieu:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(47, 191, 122, .25);
}
.nr-rdv-lieu::placeholder { color: var(--muted); }
/* Case à cocher custom : décochée = carré blanc bordure verte ; cochée =
   vert plein + coche blanche. Décochée par défaut (l'utilisateur coche). */
.nr-action-cb {
  appearance: none;
  -webkit-appearance: none;
  width: 18px; height: 18px;
  flex-shrink: 0;
  cursor: pointer;
  border: 2px solid var(--green-border, rgba(47, 191, 122, .30));
  border-radius: 4px;
  background: var(--card, #fff);
  position: relative;
  transition: background .12s, border-color .12s;
}
.nr-action-cb:checked {
  background: var(--green, #2FBF7A);
  border-color: var(--green, #2FBF7A);
}
.nr-action-cb:checked::after {
  content: '';
  position: absolute;
  left: 5px; top: 1px;
  width: 4px; height: 9px;
  border: solid var(--white, #fff);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.nr-action-label {
  flex: 1;
  font-size: 13px;
  font-weight: 700;
  color: var(--soma-text, #0D1B0F);
}
.nr-action-prio {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 100px;
  flex-shrink: 0;
}
.nr-prio-red { background: rgba(224, 32, 32, .08); color: var(--red, #E02020); }
.nr-prio-orange { background: rgba(201, 120, 0, .08); color: var(--yellow, #C97800); }
.nr-prio-green { background: rgba(47, 191, 122, .08); color: var(--green-dark, #0D6B35); }
.nr-actions-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.nr-btn-skip {
  padding: 8px 16px;
  border: 1px solid var(--soma-border, #E8ECE5);
  background: var(--soma-card, #FFFFFF);
  border-radius: 100px;
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
  color: var(--text2);
  cursor: pointer;
  transition: background .15s;
}
.nr-btn-skip:hover { background: var(--bg); }
.nr-btn-create {
  padding: 8px 18px;
  background: var(--green, #2FBF7A);
  color: #fff;
  border: none;
  border-radius: 100px;
  font-family: inherit;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: background .15s;
}
.nr-btn-create:hover { background: var(--green-dark, #0D6B35); }
.nr-btn-create:disabled { opacity: .6; cursor: not-allowed; }
