/* ============================================================
   Centro de Práctica — hoja de estilos única
   ============================================================ */

:root {
  /* Colores de marca. Se sobrescriben con los de cada empresa cliente. */
  --brand: #1d40a8;        /* azul HumanOps */
  --brand-dark: #16327f;
  --brand-2: #678df6;      /* azul claro de acento */
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e4e7ec;
  --text: #101828;
  --muted: #667085;
  --ok: #12b76a;
  --warn: #f79009;
  --danger: #d92d20;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .1);
  --shadow-lg: 0 8px 24px rgba(16, 24, 40, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0 0 .5em; line-height: 1.25; font-weight: 650; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
a { color: var(--brand); }

.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grow { flex: 1; }
.stack > * + * { margin-top: 14px; }

/* ---------------- estructura ---------------- */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar img.logo { max-height: 34px; max-width: 150px; }
.topbar .brand-name { font-weight: 650; font-size: 16px; }

.container { max-width: 1080px; margin: 0 auto; padding: 24px 20px 64px; }
.container.narrow { max-width: 560px; }
.container.wide { max-width: 1280px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card.tight { padding: 14px 16px; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

/* ---------------- controles ---------------- */

label { display: block; font-weight: 550; font-size: 13px; margin-bottom: 5px; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=color], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea { resize: vertical; min-height: 78px; }
input[type=color] { padding: 4px; height: 42px; cursor: pointer; }

.field + .field { margin-top: 14px; }

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
  transition: background .12s, opacity .12s;
  white-space: nowrap;
}
button:hover:not(:disabled), .btn:hover { background: var(--brand-dark); }
button:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary, button.secondary {
  background: #fff;
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover, button.secondary:hover { background: #f2f4f7; }

.btn-danger, button.danger { background: var(--danger); }
.btn-danger:hover, button.danger:hover { background: #b42318; }

.btn-ghost, button.ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  padding: 6px 10px;
}
.btn-ghost:hover, button.ghost:hover { background: #f2f4f7; color: var(--text); }

button.block { width: 100%; }
button.sm, .btn.sm { padding: 6px 11px; font-size: 13px; }

/* ---------------- píldoras y etiquetas ---------------- */

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 550;
  background: #f2f4f7; color: var(--muted);
}
.pill.ok { background: #d1fadf; color: #05603a; }
.pill.warn { background: #fef0c7; color: #b54708; }
.pill.danger { background: #fee4e2; color: #912018; }
.pill.info { background: #dbeafe; color: #1e40af; }

/* ---------------- barra de progreso ---------------- */

.progress {
  height: 10px;
  background: #eaecf0;
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--brand);
  border-radius: 999px;
  transition: width .5s ease;
}
.progress.big { height: 16px; }
.progress.slim { height: 6px; }

/* ---------------- tablas ---------------- */

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
tbody tr:hover { background: #fafbfc; }
td.num, th.num { text-align: right; }

/* ---------------- chat ---------------- */

.chat-window {
  height: 52vh;
  min-height: 320px;
  overflow-y: auto;
  padding: 16px;
  background: #fbfcfd;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.msg { max-width: 78%; padding: 10px 14px; border-radius: 14px; white-space: pre-wrap; word-wrap: break-word; }
.msg.user { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.system { align-self: center; background: #fef0c7; color: #b54708; font-size: 13px; max-width: 92%; text-align: center; }

.composer { display: flex; gap: 10px; margin-top: 14px; align-items: flex-end; }
.composer textarea { min-height: 46px; max-height: 160px; }

.typing { display: inline-flex; gap: 4px; align-items: center; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); display: block;
  animation: blink 1.2s infinite;
}
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ---------------- pestañas ---------------- */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button {
  background: transparent; border: none; color: var(--muted);
  padding: 10px 14px; border-bottom: 2px solid transparent;
  border-radius: 0; font-weight: 550;
}
.tabs button:hover { background: transparent; color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------------- navegación empleado ---------------- */

.nav { display: flex; gap: 6px; margin-left: auto; }
.nav button {
  background: transparent; color: var(--muted);
  border: 1px solid transparent; padding: 7px 13px;
}
.nav button:hover { background: #f2f4f7; color: var(--text); }
.nav button.active { background: var(--brand); color: #fff; }

/* ---------------- tarjetas de escenario ---------------- */

.scenario-card { display: flex; flex-direction: column; gap: 10px; }
.scenario-card h3 { margin: 0; }
.scenario-card .desc { color: var(--muted); font-size: 13.5px; flex: 1; }

/* ---------------- feedback ---------------- */

.score-ring {
  width: 96px; height: 96px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 27px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}
.feedback-list { margin: 0; padding-left: 20px; }
.feedback-list li { margin-bottom: 8px; }

/* ---------------- avisos ---------------- */

.alert { padding: 11px 14px; border-radius: 9px; font-size: 14px; border: 1px solid; }
.alert.error { background: #fef3f2; border-color: #fecdca; color: #912018; }
.alert.success { background: #ecfdf3; border-color: #a6f4c5; color: #05603a; }
.alert.info { background: #eff8ff; border-color: #b2ddff; color: #175cd3; }
.alert.warn { background: #fffaeb; border-color: #fedf89; color: #b54708; }

/* ---------------- modal ---------------- */

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(16, 24, 40, .55);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 620px; max-height: 88vh; overflow-y: auto; padding: 24px;
}
.modal.wide { max-width: 860px; }

/* ---------------- carga ---------------- */

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  animation: spin .7s linear infinite;
}
.spinner.dark { border-color: rgba(16,24,40,.2); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 8px; }

.dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 30px 20px; text-align: center; color: var(--muted);
  cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: #f5f8ff; }

/* ---------------- marca HumanOps ---------------- */

.ho-brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: inherit; }
.ho-brand svg { display: block; flex-shrink: 0; }
.ho-brand img { display: block; max-height: 34px; max-width: 150px; }
.ho-word {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .17em;
  color: var(--brand);
  text-transform: uppercase;
  line-height: 1;
}
.ho-sub { font-size: 11px; color: var(--muted); letter-spacing: .02em; margin-top: 2px; }

.powered {
  text-align: center;
  padding: 26px 16px 34px;
  color: var(--muted);
  font-size: 12px;
}
.powered a { color: var(--muted); text-decoration: none; font-weight: 550; }
.powered a:hover { color: var(--brand); text-decoration: underline; }
.powered .ho-inline {
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
}

/* ---------------- acento secundario ---------------- */

.pill.accent { background: color-mix(in srgb, var(--brand-2) 22%, white); color: var(--brand-dark); }
.topic-head {
  display: flex; align-items: center; gap: 10px;
  margin: 26px 0 12px;
}
.topic-head:first-child { margin-top: 6px; }
.topic-head h2 { margin: 0; font-size: 17px; }
.topic-head .line { flex: 1; height: 1px; background: var(--border); }
.topic-head .count { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* Barra de acento con el segundo color de la empresa */
.accent-bar { height: 4px; border-radius: 999px; background: var(--brand-2); margin-bottom: 14px; }

/* ---------------- logotipo en el panel ---------------- */

.logo-box {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: #fbfcfd;
}
.logo-preview {
  width: 118px; height: 76px; border-radius: 9px; border: 1px solid var(--border);
  background: #fff; display: grid; place-items: center; overflow: hidden; flex-shrink: 0;
}
.logo-preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.logo-preview .empty-mark { color: var(--muted); font-size: 12px; text-align: center; padding: 6px; }

.color-pair { display: flex; gap: 14px; flex-wrap: wrap; }
.color-pair .field { flex: 1; min-width: 140px; }

/* ---------------- responsive ---------------- */

@media (max-width: 640px) {
  .container { padding: 16px 14px 56px; }
  .card { padding: 16px; }
  .msg { max-width: 90%; }
  .topbar { padding: 10px 14px; gap: 10px; }
  .nav { width: 100%; margin-left: 0; order: 3; overflow-x: auto; }
  h1 { font-size: 20px; }
}
