/* SGM-323 — Email Coach panel styling.
 *
 * Brand-tokened against public/css/app.css. Zero raw hex outside the
 * already-defined SafePaaS palette. Keeps the panel readable in both
 * the Editor's right column (replacing .et-edit-panel content) and
 * SimpleEditor's new right column.
 */

/* ── Wrapper ─────────────────────────────────────────────────── */
.coach {
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  font-family: var(--font-family-app, 'Montserrat', system-ui, sans-serif);
}
.coach.collapsed {
  padding: 0;
  display: block;
  width: 50px;
  cursor: pointer;
}

/* ── Header ──────────────────────────────────────────────────── */
.coach-h {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 0 4px;
}
.coach-h h6 {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.coach-h-rubric {
  font-size: 8px;
  font-weight: 400;
  opacity: 0.7;
  letter-spacing: 0.04em;
  text-transform: none;
}
.coach-toggle {
  font-size: 14px;
  color: var(--text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.coach-toggle:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

/* ── Twin gauges ─────────────────────────────────────────────── */
.coach .gauges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.coach .gauge {
  padding: 10px 6px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-align: center;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}
.coach .gauge.good {
  background: var(--success-bg);
  border-color: var(--success-border);
}
.coach .gauge.warn {
  background: var(--warning-bg);
  border-color: var(--warning-border);
}
.coach .gauge.fail {
  background: var(--danger-bg);
  border-color: var(--danger-border);
}
.coach .gauge .num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
  transition: color 0.2s;
}
.coach .gauge .num small {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.6;
  margin-left: 1px;
}
.coach .gauge.good .num { color: var(--success); }
.coach .gauge.warn .num { color: var(--warning); }
.coach .gauge.fail .num { color: var(--danger); }
.coach .gauge .lab {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.04em;
  line-height: 1.2;
}
.coach .gauge .est-flag {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 1px 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* ── Metric cards ────────────────────────────────────────────── */
.coach .metrics-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.coach .metric {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: default;
  transition: background 0.1s;
}
.coach .metric:hover {
  background: var(--bg-card-hover);
}
.coach .metric .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.coach .metric.good .dot { background: var(--success); }
.coach .metric.warn .dot { background: var(--warning); }
.coach .metric.fail .dot { background: var(--danger); }
.coach .metric .body {
  flex: 1;
  min-width: 0;
}
.coach .metric .row1 {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
}
.coach .metric .label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
}
.coach .metric .value {
  font-size: 9px;
  color: var(--text-muted);
  font-family: var(--font-family-mono, 'JetBrains Mono', ui-monospace, monospace);
  white-space: nowrap;
}
.coach .metric .tip {
  font-size: 9px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 2px 0 0;
}

/* ── Suggestions footer ──────────────────────────────────────── */
.coach .coach-foot {
  padding: 8px 10px;
  background: var(--info-bg);
  border-radius: 6px;
  border-left: 2px solid var(--info);
  margin-top: 4px;
}
.coach .coach-foot h6 {
  margin: 0 0 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--info);
}
.coach .coach-foot ul {
  margin: 0;
  padding-left: 14px;
  font-size: 9px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.coach .coach-foot li { margin-bottom: 2px; }
.coach .coach-foot li.suggestion-empty {
  list-style: none;
  margin-left: -14px;
  font-style: italic;
  color: var(--text-muted);
}
.coach .coach-foot li .impact {
  font-family: var(--font-family-mono, monospace);
  font-size: 8px;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 0 4px;
  border-radius: 3px;
  font-weight: 700;
  margin-left: 4px;
}

/* ── Empty state ─────────────────────────────────────────────── */
.coach .coach-empty {
  text-align: center;
  padding: 18px 12px;
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.5;
}
.coach .coach-empty-icon {
  font-size: 24px;
  margin-bottom: 6px;
  opacity: 0.4;
}
.coach .coach-empty p { margin: 0; }

/* ── Collapsed state — vertical strip ────────────────────────── */
.coach .coach-collapsed-strip {
  padding: 12px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  height: 100%;
}
.coach .mini-gauge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-family-mono, monospace);
}
.coach .mini-gauge.good { background: var(--success-bg); border-color: var(--success); color: var(--success); }
.coach .mini-gauge.warn { background: var(--warning-bg); border-color: var(--warning); color: var(--warning); }
.coach .mini-gauge.fail { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.coach .coach-collapsed-label {
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

/* ── SimpleEditor body shrinks to make room for the coach column ── */
.et-shell .et-simple-body.with-coach {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  padding: 0;
  max-width: 100%;
}
.et-shell .et-simple-body.with-coach .et-simple-rte {
  padding: 24px 32px 60px;
  max-width: 760px;
  margin: 0;
}
.et-shell .et-simple-body.with-coach .coach {
  padding: 16px 12px;
  border-left: 1px solid var(--border);
  background: var(--bg-card);
  max-height: 100%;
}

@media (max-width: 980px) {
  .et-shell .et-simple-body.with-coach { grid-template-columns: 1fr; }
  .et-shell .et-simple-body.with-coach .coach { border-left: 0; border-top: 1px solid var(--border); }
}
