/* Identidad visual PRORED Zona Norte / ProcessMaker — hoja base de referencia.
   Extraída de la app (src/public/css/styles.css): tokens, barra superior, botones,
   tarjetas, stepper, formularios, tablas, chips y estados. Solo tema claro. */
:root {
  --slate: #485562;
  --slate-deep: #3a4550;
  --bg: #edf1f2;
  --card: #ffffff;
  --line: #d3d9e0;
  --line-soft: #e6eaee;
  --ink: #364152;
  --muted: #7a8494;
  --naranja: #f47b20;
  --naranja-deep: #d9670f;
  --naranja-soft: #fde9d9;
  --verde: #70ad47;
  --verde-soft: #e8f2df;
  --azul: #4f5b9e;
  --azul-soft: #e6e8f3;
  --rojo: #b3261e;
  --rojo-soft: #fdecea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(35, 43, 49, 0.05), 0 8px 24px rgba(35, 43, 49, 0.07);
  --font: 'Carlito', Calibri, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
}

a { color: var(--azul); }
:focus-visible { outline: 2px solid var(--naranja); outline-offset: 2px; }

/* ---------- barra superior ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 12px 32px;
  background: var(--slate);
  color: #fff;
  box-shadow: 0 2px 12px rgba(35, 43, 49, 0.18);
}

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: #fff; }
.brand__logo {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 5px 10px;
  background: #fff;
  border-radius: 9px;
}
.brand__logo img { height: 100%; width: auto; display: block; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong { font-size: 1.15rem; letter-spacing: 0.01em; }
.brand__text small { font-size: 0.78rem; color: #c3ccd6; font-style: italic; }

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav__link {
  padding: 8px 16px;
  border-radius: 999px;
  color: #d6dde4;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s;
}
.nav__link:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav__link.is-active { background: #fff; color: var(--slate); }
.nav__link--manual { display: inline-flex; align-items: center; gap: 6px; }
.nav__icon { width: 16px; height: 16px; flex: none; }

.usermenu { margin-left: 8px; padding-left: 20px; border-left: 1px solid rgba(255, 255, 255, 0.18); display: flex; align-items: center; gap: 12px; }
.usermenu form { margin: 0; }
.usermenu__name { font-size: 0.95rem; color: #e6ebf0; }
.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--naranja);
  color: #fff;
  font-weight: 700;
}

.btn-ghost-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- botones ---------- */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s;
}
.btn-primary { background: var(--naranja); color: #fff; box-shadow: 0 2px 0 var(--naranja-deep); }
.btn-primary:hover { background: var(--naranja-deep); }
.btn-primary:active { transform: translateY(1px); box-shadow: none; }
.btn-primary:disabled { background: #efc9a9; box-shadow: none; cursor: not-allowed; }
.btn-secondary { background: #fff; color: var(--slate); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--slate); background: #f6f8f9; }
.btn-secondary:disabled { color: #a9b1bc; cursor: not-allowed; background: #f6f8f9; }
.btn-danger { background: #fff; color: var(--rojo); border-color: #efc4c0; }
.btn-danger:hover { background: var(--rojo-soft); }
.btn-generate { width: 100%; padding: 13px 18px; font-size: 1.02rem; }
.btn-icon { width: 18px; height: 18px; flex: none; }

/* ---------- estructura de página ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px;
  padding: 24px 32px 48px;
  max-width: 1680px;
  margin: 0 auto;
  align-items: start;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-panel, .preview-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.form-panel { padding: 22px 26px 24px; }
.preview-panel { position: sticky; top: 92px; padding: 20px 22px 22px; }
.preview-panel__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.preview-panel h2 { margin: 0; font-size: 1.15rem; }
.preview-panel__tag { font-size: 0.8rem; color: var(--muted); font-style: italic; }

.page-wrap { max-width: 1100px; margin: 0 auto; padding: 28px 32px 56px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 1.8rem; line-height: 1.1; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---------- stepper ---------- */
.steps {
  position: relative;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 4px;
  scrollbar-width: thin;
}
.step-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.step-pill:hover { border-color: var(--slate); color: var(--slate); }
.step-pill .n {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  color: var(--slate);
  font-size: 0.85rem;
}
.step-pill.active { background: var(--slate); border-color: var(--slate); color: #fff; }
.step-pill.active .n { background: var(--naranja); color: #fff; }
.step-pill.done .n { background: var(--verde); color: #fff; }
.step-progress { height: 4px; background: var(--line-soft); border-radius: 4px; overflow: hidden; margin-bottom: 20px; }
.step-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--naranja), var(--verde)); transition: width 0.25s; }

fieldset.step { border: none; padding: 0; margin: 0 0 8px; min-width: 0; }
fieldset.step legend { padding: 0; margin-bottom: 4px; font-size: 1.35rem; font-weight: 700; color: var(--slate); }
fieldset.step h3 { margin: 4px 0 10px; font-size: 1rem; color: var(--slate); }

/* ---------- formularios ---------- */
label { display: block; margin-bottom: 14px; font-size: 0.9rem; font-weight: 700; color: var(--slate); }
label input[type="text"], label input[type="email"], label input[type="password"], label input[type="number"],
label select, textarea, input.input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfc;
  color: var(--ink);
  font: inherit;
  font-weight: 400;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea { resize: vertical; min-height: 84px; }
label input:focus, label select:focus, textarea:focus, input.input:focus {
  outline: none;
  border-color: var(--azul);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(79, 91, 158, 0.18);
}
label input::placeholder, textarea::placeholder { color: #a5aebb; }
label.checkbox { display: flex; align-items: center; gap: 10px; font-weight: 400; cursor: pointer; }
label.checkbox input { width: 18px; height: 18px; accent-color: var(--naranja); margin: 0; }
input[type="color"] { width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
input[type="file"] { margin-top: 6px; font: inherit; font-size: 0.9rem; font-weight: 400; }

.subblock { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; padding: 12px 14px; background: var(--bg); border-radius: 10px; }
.subblock label { margin: 0; display: flex; align-items: center; gap: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0 0 12px; }

.repeat-item {
  position: relative;
  padding: 14px 14px 4px;
  margin-bottom: 12px;
  background: #f7f9fa;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.repeat-item .remove-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
  z-index: 1;
}
.repeat-item .remove-btn:hover { background: var(--rojo-soft); color: var(--rojo); box-shadow: 0 0 0 1px #efc4c0; }
.repeat-item label:first-of-type { padding-right: 30px; }

.fase-checks { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.fase-checks label { display: flex; align-items: center; gap: 6px; margin: 0; padding: 5px 12px; font-size: 0.85rem; font-weight: 400; background: #fff; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.fase-checks input { width: auto; margin: 0; accent-color: var(--naranja); }

.step-actions { display: flex; justify-content: space-between; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }

/* ---------- vista previa ---------- */
.preview-container {
  width: 100%;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: var(--bg);
}
.preview-container svg { display: block; width: 100%; height: auto; }
.generate-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#generate-status { min-height: 1.3em; margin: 12px 0 0; }


/* ---------- tablas (historial / usuarios) ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; }
.search { flex: 1; max-width: 360px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; }
.search:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 3px rgba(79, 91, 158, 0.18); }
.table-card { overflow: hidden; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  padding: 12px 18px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f6f8f9;
  border-bottom: 1px solid var(--line);
}
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: #f8fafb; }
.cell-main { font-weight: 700; color: var(--slate); }
.cell-sub { font-size: 0.85rem; color: var(--muted); }
.person { display: flex; align-items: center; gap: 10px; }
.person .avatar { width: 30px; height: 30px; font-size: 0.85rem; background: var(--azul); }
.acciones { display: flex; gap: 6px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.acciones form { margin: 0; }
.chip-btn {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--slate);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.chip-btn:hover { border-color: var(--slate); background: #f4f6f7; }
.chip-btn.pptx { color: var(--naranja-deep); border-color: #f3cfb3; background: var(--naranja-soft); }
.chip-btn.pdf { color: var(--azul); border-color: #ccd0e6; background: var(--azul-soft); }
.chip-btn.duplicar { color: #4a7a2e; border-color: #cfe3bd; background: var(--verde-soft); }
.chip-btn.drive { color: #1a73e8; border-color: #cfe0fb; background: #eaf1fd; }
.chip-btn.activar { color: #4a7a2e; border-color: #cfe3bd; background: var(--verde-soft); }
.chip-btn.desactivar { color: var(--naranja-deep); border-color: #f3cfb3; background: var(--naranja-soft); }
.chip-btn.danger { color: var(--rojo); }
.chip-btn.danger:hover { background: var(--rojo-soft); border-color: #efc4c0; }
.estado { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.estado--activo { color: #3f6b27; background: var(--verde-soft); }
.estado--inactivo { color: var(--muted); background: #eceff1; }
.row-inactiva .cell-main, .row-inactiva td:nth-child(2), .row-inactiva td:nth-child(3) { opacity: 0.55; }
.notice { margin: 0 0 16px; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.notice--warn { color: #8a4b0a; background: var(--naranja-soft); border: 1px solid #f3cfb3; }
.empty { padding: 48px 20px; text-align: center; color: var(--muted); }
.empty .squares { justify-content: center; margin-bottom: 14px; opacity: 0.55; }
.empty .squares span { width: 20px; height: 20px; border-radius: 5px; }

.form-card { max-width: 520px; padding: 26px 28px 22px; }


/* ---------- estados del proceso ---------- */
.estado-proceso { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; border-radius: 999px; font-size: 0.82rem; font-weight: 700; white-space: nowrap; border: 1.5px solid transparent; }
.estado-proceso--terminado { color: #2f7332; background: #e3f1da; border-color: #3e8e41; }
.estado-proceso--en_proceso { color: #8a5600; background: #fcf0d6; border-color: #d98b00; }
.estado-proceso--por_iniciar { color: #5d6978; background: #eceff1; border-color: #7a8494; border-style: dashed; }
.notice--info { color: #35456f; background: var(--azul-soft); border: 1px solid #ccd0e6; }
.estado-proceso--off { color: #5d6978; background: #e3e7ea; border-color: #9aa3ad; }
