/* ============================================================
   RADIANT · Panel coach — Feedback v2b
   Asistente, Equipo, Formularios, Biblioteca 2 ejes, Lectura de carga
   ============================================================ */

/* Sidebar item IA */
.side-item--ai.is-active { background: linear-gradient(100deg, var(--forest), #4a3a26); }
.side-badge, .h1-badge {
  font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
  color: #2b1e14; background: linear-gradient(100deg, var(--ember), #e0a94a);
  padding: 2px 6px; border-radius: 6px; margin-left: auto;
}
.h1-badge { margin-left: 8px; vertical-align: 4px; }
.section-h-sub { font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--ink-3); }

/* ---- Asistente ---- */
.ai-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; align-items: start; margin-bottom: 8px; }
.ai-copilot { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; min-height: 420px; }
.ai-thread { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; padding-bottom: 8px; }
.ai-bubble { max-width: 88%; font-size: 13.5px; line-height: 1.5; padding: 11px 14px; border-radius: 16px; }
.ai-bubble--coach { align-self: flex-end; background: var(--forest); color: #f6ecde; border-bottom-right-radius: 5px; }
.ai-bubble--ai { align-self: flex-start; background: var(--ember-soft); color: #4a3411; border-bottom-left-radius: 5px; }
.ai-tag { display: block; font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ember-2); margin-bottom: 4px; }
.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.ai-chip { font-family: var(--font-body); font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; cursor: pointer; transition: all .15s; }
.ai-chip:hover { color: var(--ink); border-color: var(--ember); }
.ai-input-row { display: flex; gap: 8px; align-items: center; }
.ai-input-row input { flex: 1; font-family: var(--font-body); font-size: 14px; color: var(--ink); background: var(--bg); border: none; border-radius: 999px; padding: 12px 16px; outline: none; }
.ai-send { width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; background: var(--forest); color: #fff; border: none; cursor: pointer; }

.ai-drafts { display: flex; flex-direction: column; gap: 14px; }
.draft-card { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; border: 1px solid var(--ember-soft); }
.draft-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 14px; }
.draft-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ember-2); }
.draft-title { font-size: 17px; font-weight: 700; margin-top: 3px; }
.draft-tag { font-size: 11px; font-weight: 700; color: #94570f; background: var(--ember-soft); padding: 3px 9px; border-radius: 999px; margin-left: 6px; vertical-align: 2px; }
.draft-ai { color: var(--ember); flex: 0 0 auto; }
.draft-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.draft-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.draft-row:last-child { border-bottom: none; }
.draft-dir { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 10px; flex: 0 0 auto; }
.draft-dir.d-up { color: #4f7a3f; background: #eaf1e4; }
.draft-dir.d-flat { color: var(--ink-3); background: var(--bg); }
.draft-dir.d-down { color: var(--danger); background: #f7e7e2; }
.draft-info { flex: 0 0 auto; min-width: 130px; }
.draft-ex { display: block; font-weight: 700; font-size: 13.5px; }
.draft-change { font-size: 12px; color: var(--ink); }
.draft-reason { flex: 1; font-size: 12px; color: var(--ink-3); font-style: italic; text-align: right; }
.draft-actions { display: flex; justify-content: flex-end; gap: 8px; }
.draft-card--nutri { border-color: var(--celeste-soft); }
.nutri-sugg { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); margin: 8px 0 16px; }
.nutri-sugg strong { color: var(--ink); }

/* Lectura de carga */
.load-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.load-matrix { width: 100%; border-collapse: separate; border-spacing: 6px; }
.load-matrix th { font-size: 11px; color: var(--ink-3); text-transform: none; letter-spacing: 0; padding: 4px; border: none; text-align: center; }
.load-matrix th:first-child { text-align: right; }
.load-matrix td { position: relative; text-align: center; font-size: 12.5px; font-weight: 700; border-radius: 10px; padding: 14px 6px; border: none; }
.load-matrix .m-up { background: #eaf1e4; color: #4f7a3f; }
.load-matrix .m-flat { background: var(--ember-soft); color: #94570f; }
.load-matrix .m-down { background: #f7e7e2; color: var(--danger); }
.load-matrix td.is-here { outline: 2.5px solid var(--forest); }
.load-matrix td.is-here i { position: absolute; left: 0; right: 0; bottom: 3px; font-size: 8.5px; font-style: normal; font-weight: 700; color: var(--forest); }
.load-legend { font-size: 12px; color: var(--ink-3); margin-top: 12px; }
.load-stat { display: flex; align-items: baseline; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2); }
.load-stat strong { font-size: 17px; font-weight: 700; color: var(--ink); }
.load-stat--hero strong { color: var(--ember); font-size: 22px; }
.load-gauge { position: relative; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #f7e7e2, #eaf1e4 45% 65%, #f7e7e2); margin: 14px 0 20px; }
.load-gauge-fill { position: absolute; top: -3px; width: 3px; height: 14px; border-radius: 3px; background: var(--forest); transition: left .4s; }
.load-gauge-zone { position: absolute; top: 12px; left: 0; right: 0; text-align: center; font-size: 10px; color: var(--ink-3); }
.load-verdict { font-size: 13px; color: var(--ink-2); }
.load-verdict strong { color: #4f7a3f; }
.ai-note { margin-top: 22px; padding: 14px 16px; border-radius: var(--r-md); background: var(--ember-soft); font-size: 13px; color: #5a4114; line-height: 1.5; }
.ai-note strong { color: #3a2a0c; }

/* ---- Equipo ---- */
.coach-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 8px; }
.coach-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 14px 16px; }
.coach-name { font-weight: 700; font-size: 14px; }
.coach-role { font-size: 12px; color: var(--ink-3); }
.coach-count { margin-left: auto; font-weight: 700; font-size: 15px; color: var(--ember); }
.team-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.notes-list { display: flex; flex-direction: column; gap: 10px; }
.note-item { display: flex; gap: 12px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 13px 14px; align-items: flex-start; }
.note-item.is-resolved { opacity: .55; }
.avatar--sm { width: 30px; height: 30px; font-size: 11px; }
.note-main { flex: 1; min-width: 0; }
.note-for { font-size: 12px; font-weight: 700; color: var(--ink); }
.note-when { color: var(--ink-3); font-weight: 500; }
.note-body { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; margin-top: 3px; }
.mention { color: var(--ember-2); font-weight: 700; }
.note-resolve { width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; background: var(--bg); border: 1px solid var(--line); color: var(--ink-3); cursor: pointer; }
.note-item.is-resolved .note-resolve { color: #4f7a3f; background: #eaf1e4; border-color: transparent; }
.note-compose { display: flex; gap: 8px; margin-top: 12px; }
.note-compose input { flex: 1; font-family: var(--font-body); font-size: 13.5px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 11px 15px; outline: none; }
.note-compose input:focus { border-color: var(--ember); }
.leads-list { display: flex; flex-direction: column; gap: 10px; }
.lead-card { display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 13px 15px; }
.lead-info { flex: 1; min-width: 0; }
.lead-name { font-weight: 700; font-size: 13.5px; }
.lead-status { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; text-transform: uppercase; letter-spacing: .04em; }
.lead-status.s-nuevo { color: #4f7a3f; background: #eaf1e4; }
.lead-status.s-contactada { color: var(--ink-3); background: var(--bg); }
.lead-meta { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.lead-wa { width: 38px; height: 38px; border-radius: 11px; flex: 0 0 auto; display: grid; place-items: center; background: #eaf1e4; color: #3f7a4f; border: none; cursor: pointer; }

/* ---- Formularios ---- */
.forms-tabs { margin-bottom: 12px; }
.forms-hint { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.obj-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.obj-chip { font-family: var(--font-body); font-size: 12.5px; font-weight: 600; color: var(--ink-2); background: var(--card); box-shadow: var(--shadow); border: none; border-radius: 999px; padding: 9px 15px; cursor: pointer; transition: all .15s; }
.obj-chip.is-active { color: #fff; background: var(--forest); }
.builder-forms { display: grid; grid-template-columns: 180px 1fr 180px; gap: 14px; align-items: start; }
.fb-title { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.fb-sections, .fb-fields { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; }
.fb-section, .fb-field { display: block; width: 100%; text-align: left; font-family: var(--font-body); font-size: 13px; font-weight: 600; color: var(--ink-2); background: var(--bg); border: none; border-radius: 10px; padding: 10px 12px; margin-bottom: 7px; cursor: pointer; transition: all .15s; }
.fb-section.is-active { color: #2b1e14; background: var(--ember-soft); }
.fb-field { position: relative; }
.fb-field:hover { color: var(--ink); background: var(--ember-soft); }
.fb-field.is-special { color: var(--ember-2); }
.fb-field i { position: absolute; right: 12px; font-style: normal; }
.fb-canvas { background: var(--card); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 16px; }
.fb-block { border: 1.5px dashed var(--line); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; }
.fb-block-title { font-weight: 700; font-size: 13.5px; }
.fb-block-detail { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; }
.fb-block--tca { border-color: var(--ember); background: var(--ember-soft); }

/* ---- Biblioteca 2 ejes + afinidad ---- */
.lib-controls { flex-direction: column; align-items: stretch; gap: 12px; }
.lib-axis { display: flex; align-items: center; gap: 10px; }
.axis-lab { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); width: 62px; flex: 0 0 auto; }
.chip--fn.is-active { color: #2b1e14; background: var(--ember-soft); border-color: var(--ember); }
.chip--add { font-weight: 700; padding: 7px 12px; }
.lib-avisar { display: flex; align-items: flex-start; gap: 9px; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; background: var(--ember-soft); border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 14px; }
.lib-avisar svg { color: var(--ember-2); flex: 0 0 auto; margin-top: 2px; }
.lib-avisar strong { color: var(--ink); }
.col-affin { width: 44px; text-align: center; }
.affin-star { background: none; border: none; font-size: 18px; color: var(--ink-3); cursor: pointer; line-height: 1; }
.affin-star.is-on { color: var(--ember); }
.ex-fns { display: flex; gap: 5px; margin-top: 4px; }
.fn-pill { font-size: 9.5px; font-weight: 700; color: var(--ember-2); background: var(--ember-soft); padding: 2px 7px; border-radius: 6px; }
.tag-excl { color: var(--danger); background: #f7e7e2; }

/* ---- Modal alta clienta ---- */
.modal--wide { max-width: 640px; }
.modal-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 16px; }
.m-label--sm { font-size: 11px; }
.intake-fields { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.tca-box { background: var(--ember-soft); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 18px; }
.tca-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: #94570f; margin-bottom: 12px; }
.tca-flags { display: flex; flex-direction: column; gap: 9px; }
.tca-check { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.tca-check input { width: 16px; height: 16px; accent-color: var(--ember); }
.tca-note { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; margin-top: 12px; }

/* ---- Entreno D1: editorial + progresión ---- */
.editorial-note { display: flex; gap: 10px; align-items: flex-start; background: var(--card); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 12px 14px; margin-bottom: 14px; }
.editorial-note svg { color: var(--ember-2); flex: 0 0 auto; margin-top: 3px; }
.editorial-note textarea { flex: 1; font-family: var(--font-body); font-size: 13px; color: var(--ink); background: none; border: none; outline: none; resize: none; line-height: 1.5; }

@media (max-width: 1080px) {
  .ai-grid, .load-grid, .team-grid { grid-template-columns: 1fr; }
  .builder-forms { grid-template-columns: 1fr; }
  .intake-fields { grid-template-columns: 1fr; }
}

.ba-left { display: flex; gap: 10px; flex-wrap: wrap; }

/* ============================================================
   Pase de pulido · ritmo, jerarquía, elevación
   ============================================================ */

/* Jerarquía de secciones consistente y con aire */
.section-h {
  font-family: var(--font-body); font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em; color: var(--ink);
  margin: 38px 0 16px; display: flex; align-items: baseline; gap: 10px;
}
.section-h:first-child { margin-top: 6px; }

/* Elevación al pasar el ratón (cohesión premium) */
.stat-card, .draft-card, .coach-card, .note-item, .lead-card, .tpl-card, .signal-card {
  transition: transform .18s ease, box-shadow .25s ease;
}
.stat-card:hover, .coach-card:hover, .lead-card:hover {
  transform: translateY(-3px); box-shadow: var(--shadow-hover);
}

/* Equipo — más aire y columnas equilibradas */
.coach-row { gap: 14px; margin-bottom: 34px; }
.coach-card { padding: 16px 18px; }
.team-grid { gap: 32px; margin-top: 4px; }
.notes-list, .leads-list { gap: 12px; }
.note-item, .lead-card { padding: 15px 16px; border-radius: var(--r-lg); }
.note-compose { margin-top: 16px; }
.note-compose input { padding: 13px 18px; }

/* Asistente — respiración entre bloques */
.ai-grid { gap: 20px; margin-bottom: 6px; }
.ai-copilot { padding: 20px; }
.ai-drafts { gap: 16px; }
.draft-card { padding: 20px; }
.load-grid { gap: 20px; margin-bottom: 8px; }

/* Formularios / biblioteca — un punto más de aire */
.builder-forms { gap: 18px; }
.obj-row { gap: 9px; margin-bottom: 26px; }
.lib-avisar { padding: 13px 16px; margin-bottom: 18px; }

/* Cabeceras de tarjeta un poco más marcadas */
.card-h { font-size: 15.5px; }

/* ---- Rejilla tipo hoja: acciones de fila + arrastrar ---- */
.col-actions { white-space: nowrap; text-align: right; }
.col-actions button {
  width: 30px; height: 30px; border-radius: 8px; padding: 0;
  display: inline-grid; place-items: center; vertical-align: middle;
  background: transparent; border: none; color: var(--ink-3); cursor: pointer;
  transition: background .15s, color .15s;
}
.col-actions button:hover { background: var(--bg); color: var(--ink); }
.row-del:hover { color: var(--danger); background: #f7e7e2; }
.row-dup:hover { color: var(--ember-2); background: var(--ember-soft); }
.row-grip { cursor: grab; }
.row-grip:active { cursor: grabbing; }

.builder-table tbody tr.is-dragging { opacity: .4; }
.builder-table tbody tr.drop-above td { box-shadow: inset 0 3px 0 -1px var(--ember); }
.builder-table tbody tr.drop-below td { box-shadow: inset 0 -3px 0 -1px var(--ember); }

/* Compactar la rejilla para que quepan las 3 acciones sin scroll */
.builder-table th, .builder-table td { padding-left: 10px; padding-right: 10px; }
.builder-table th:first-child, .builder-table td:first-child { padding-left: 14px; }
.builder-table .sel-ex { max-width: 176px; }
.builder-table select, .builder-table input { min-width: 0; }
.col-actions { padding-left: 4px; }
.col-actions button { width: 27px; height: 27px; }

