:root {
  --ink: #1f2933;
  --muted: #637381;
  --line: #e3e8ee;
  --panel: #ffffff;
  --soft: #f7f9fb;
  --nav: #ffffff;
  --teal: #25666a;
  --teal-soft: #edf7f6;
  --amber: #9a6a16;
  --amber-soft: #fff7e8;
  --red: #b42318;
  --red-soft: #fff0ed;
  --blue-soft: #f1f5f9;
  --shadow: 0 1px 2px rgba(31, 41, 51, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f7f9fb;
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(360px, 520px) minmax(280px, 420px);
  gap: 18px;
  align-items: start;
  justify-content: center;
  padding: 56px 24px;
}

.login-card,
.login-aside {
  background: var(--panel);
  border: 1px solid var(--line);
}

.login-card {
  padding: 28px;
}

.login-brand {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.login-copy {
  margin: 24px 0 20px;
}

.login-copy h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.login-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.login-form {
  display: grid;
  gap: 10px;
}

.login-form .primary-button,
.login-form .ghost-button {
  width: 100%;
  margin-top: 4px;
}

.login-aside {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.form-status,
.save-status {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.form-status.error,
.save-status.error {
  color: var(--red);
}

.form-status.ok,
.save-status.ok {
  color: var(--teal);
}

.app-container {
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--nav);
  color: var(--ink);
  padding: 6px 10px;
  display: grid;
  grid-template-columns: minmax(210px, 240px) minmax(220px, 1fr) auto minmax(190px, 240px) minmax(190px, 240px);
  gap: 8px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--teal);
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand h1,
.brand p,
.identity-panel h2,
.identity-panel p {
  margin: 0;
}

.brand h1 {
  font-size: 15px;
}

.brand p,
.identity-panel,
.coverage-card {
  color: var(--muted);
}

.identity-panel,
.coverage-card {
  padding: 6px 8px;
  background: var(--soft);
  border: 1px solid var(--line);
  margin-bottom: 0;
}

.identity-panel h2 {
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 4px;
}

.identity-panel dl {
  display: grid;
  grid-template-columns: minmax(100px, auto) minmax(120px, 1fr);
  gap: 2px 14px;
}

.identity-panel dl > div {
  min-width: 0;
}

.identity-panel dd {
  margin-bottom: 0;
}

dl {
  margin: 0;
}

dt {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

dd {
  margin: 2px 0 6px;
}

.steps {
  display: flex;
  gap: 4px;
  margin-bottom: 0;
  overflow-x: auto;
}

.progressive-steps {
  overflow: visible;
}

.step-button {
  width: auto;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.step-button.active {
  background: var(--teal-soft);
  color: var(--teal);
}

.step-button.locked {
  color: #7a8793;
  background: #f3f6f8;
  cursor: not-allowed;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0;
}

.meter {
  height: 7px;
  background: #e6edf3;
  overflow: hidden;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: var(--teal);
  transition: width 180ms ease;
}

.coverage-card .small {
  display: none;
}

.release-card {
  border: 1px solid var(--line);
  background: #fff;
  padding: 6px 8px;
}

.release-card .eyebrow {
  margin-bottom: 6px;
}

#releaseStatus {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.release-item {
  display: grid;
  align-content: start;
  gap: 3px;
  padding: 0;
  border-top: 0;
}

.release-item.open,
.release-item.pending,
.release-item.locked {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.release-item + .release-item {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.release-item.quiet,
.release-item small {
  display: none;
}

.release-item strong {
  color: var(--ink);
}

.release-item span {
  width: fit-content;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 700;
  background: #eef6f4;
  color: var(--teal);
}

.release-item.pending span {
  background: #fff4db;
  color: #8a5b00;
}

.release-item.locked span {
  background: #eef1f4;
  color: #64717d;
}

.release-item.quiet strong {
  color: var(--muted);
}

.release-item small {
  color: var(--muted);
  line-height: 1.25;
}

.app-shell {
  margin-left: 0;
  min-height: 100vh;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--panel);
  padding: 0 0 10px;
  box-shadow: none;
  border: 1px solid var(--line);
  border-width: 0 0 1px;
  margin-bottom: 12px;
}

.topbar h2,
.section-heading h3,
.assistant-header h3 {
  margin: 0;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 10px;
}

.primary-button,
.ghost-button {
  min-height: 38px;
  border: 1px solid var(--teal);
  padding: 0 14px;
  font-weight: 700;
}

.primary-button {
  background: var(--teal);
  color: #fff;
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost-button {
  background: #fff;
  color: var(--teal);
}

.ghost-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.danger-button {
  min-height: 38px;
  border: 1px solid var(--red);
  padding: 0 14px;
  background: #fff;
  color: var(--red);
  font-weight: 700;
}

.danger-button:hover,
.danger-button:focus-visible {
  background: var(--red-soft);
}

.danger-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.confirmation-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 1px solid #bcc8d1;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 18px 48px rgba(16, 35, 47, 0.24);
}

.confirmation-dialog::backdrop {
  background: rgba(24, 38, 49, 0.48);
}

.confirmation-dialog-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
}

.confirmation-dialog-heading h2,
.confirmation-dialog-panel p {
  margin: 0;
}

.confirmation-dialog-heading h2 {
  font-size: 22px;
}

.confirmation-dialog-panel > p {
  line-height: 1.5;
}

.confirmation-dialog-detail {
  padding: 12px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  color: var(--ink);
}

.confirmation-dialog.danger .confirmation-dialog-detail {
  border-left-color: var(--red);
  background: var(--red-soft);
}

.confirmation-dialog.danger #confirmationAccept {
  border-color: var(--red);
  background: var(--red);
}

.confirmation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  align-items: start;
}

.main-panel,
.assistant-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: none;
}

.main-panel {
  min-height: 720px;
}

.view {
  display: none;
  padding: 20px;
}

.view.active {
  display: block;
}

.waiting-state {
  width: min(680px, 100%);
  margin: 80px auto;
  padding: 32px;
  border: 1px solid var(--line);
  background: #fff;
}

.waiting-state h3 {
  margin: 0 0 12px;
  font-size: 24px;
}

.waiting-state > p:not(.eyebrow) {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.5;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.section-heading p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
}

.search-row,
.split-row {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.split-row {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: end;
}

label {
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
}

/* Las casillas y los botones de opción no son campos de texto: la regla anterior
   les aplicaba ancho completo, alto mínimo, relleno y borde. Como suelen ir en
   una fila flexible, el ancho se repartía según el largo de cada etiqueta y cada
   control quedaba en una posición distinta. Se normalizan una sola vez aquí para
   que ningún componente tenga que acordarse de deshacerlo. */
input[type="checkbox"],
input[type="radio"] {
  flex: none;
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  accent-color: var(--teal);
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: 2px solid rgba(37, 102, 106, 0.18);
  outline-offset: 2px;
}

.family-list {
  display: grid;
  gap: 12px;
}

.family-card {
  border: 1px solid var(--line);
  background: #fff;
}

.family-step-card {
  padding: 14px;
}

.family-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.family-head h4 {
  margin: 0 0 4px;
  font-size: 16px;
}

.family-head p {
  margin: 0;
  color: var(--muted);
}

.family-actions {
  display: flex;
  gap: 8px;
  align-items: start;
}

.choice-button {
  min-height: 34px;
  border: 1px solid var(--line);
  background: var(--soft);
  padding: 0 10px;
  color: var(--ink);
}

.choice-button.active-use {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: #155356;
}

.choice-button.active-no {
  border-color: var(--amber);
  background: var(--amber-soft);
  color: #5f3d08;
}

.family-body {
  padding: 14px;
}

.family-step-card .family-body {
  padding: 14px 0 0;
}

.family-nav {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.examples {
  margin: 0 0 12px;
  color: var(--muted);
}

.data-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.check-option {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

.check-option:hover {
  border-color: #bfd0dc;
  background: var(--soft);
}

.check-option input {
  margin-top: 3px;
}

.option-label {
  flex: 1;
}

.option-tooltip {
  width: 20px;
  height: 20px;
  min-width: 20px;
  margin-left: auto;
  font-size: 11px;
}

.status-line {
  margin-top: 12px;
  color: var(--muted);
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 700;
}

.tag.warning {
  background: var(--amber-soft);
  color: #7c4c0a;
}

.tag.danger {
  background: var(--red-soft);
  color: var(--red);
}

.function-flag {
  margin-top: 8px;
}

.hint-box {
  border: 1px solid var(--line);
  background: #fff;
  border-left: 3px solid var(--teal);
  padding: 12px;
}

.hint-box span {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.function-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--line);
  background: #fff;
}

.function-matrix {
  overflow-x: auto;
}

.function-filter-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  background: #fff;
  color: var(--ink);
  padding: 12px;
  margin-bottom: 12px;
}

.function-filter-note span {
  display: block;
  margin-top: 2px;
}

.function-table th,
.function-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.function-table th {
  background: var(--soft);
  color: var(--ink);
  font-size: 13px;
}

.function-table tr.selected-row td {
  background: var(--teal-soft);
}

.function-table tr.generic-row td {
  background: #fffaf0;
}

.function-table tr.received-unused-row td {
  background: #f5f8fa;
  border-top: 2px solid var(--teal);
  border-bottom: 2px solid var(--teal);
}

.function-table tr.received-unused-row.selected-row td {
  background: var(--teal-soft);
}

.function-table tr.public-source-row td {
  background: #eef5fb;
  border-top: 2px solid #0c69b2;
  border-bottom: 2px solid #0c69b2;
}

.function-table tr.public-source-row.selected-row td {
  background: #e2f0fb;
}

.function-table tr.public-source-row .function-special-help {
  border-left-color: #0c69b2;
}

.function-special-help {
  display: block;
  max-width: 76ch;
  margin-top: 8px;
  padding-left: 10px;
  border-left: 3px solid var(--teal);
  color: var(--muted);
  line-height: 1.45;
}

.function-table td small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.ops {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.op-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  padding: 5px 7px;
  background: #fff;
}

.op-chip input {
  width: auto;
  min-height: 0;
}

.row-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.row-check input {
  margin-top: 3px;
}

.row-picker {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.row-picker p {
  margin: 8px 0 0;
  color: var(--muted);
}

.row-context {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: #fff;
  padding: 14px;
}

.row-context h4,
.row-context p {
  margin: 0;
}

.row-context p + p {
  margin-top: 8px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field-card {
  border: 1px solid var(--line);
  padding: 14px;
  background: #fff;
}

.question-card {
  grid-column: 1 / -1;
}

.field-card h4 {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  margin: 0 0 8px;
}

.field-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.question-field + .question-field {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.readonly-value {
  border: 1px solid var(--line);
  border-left: 3px solid var(--teal);
  background: #fff;
  padding: 12px;
}

.readonly-value strong,
.readonly-value span {
  display: block;
}

.readonly-value span {
  margin-top: 6px;
  color: var(--muted);
}

.question-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.question-meter {
  background: var(--soft);
  margin-bottom: 14px;
}

.question-meter span {
  background: var(--teal);
}

.multi-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.question-warning {
  margin: 10px 0 0;
  color: var(--red);
  font-weight: 700;
}

.question-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.tooltip {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.tooltip[aria-expanded="true"] {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.tooltip-popover {
  position: fixed;
  z-index: 4000;
  width: min(360px, calc(100vw - 24px));
  max-height: min(260px, calc(100vh - 24px));
  padding: 14px 42px 14px 14px;
  overflow: auto;
  border: 1px solid #a9bdc8;
  background: #fff;
  color: var(--ink);
  line-height: 1.45;
  box-shadow: 0 12px 32px rgba(16, 35, 47, 0.22);
}

.tooltip-popover[hidden] {
  display: none;
}

.tooltip-popover strong,
.tooltip-popover p {
  display: block;
  margin: 0;
}

.tooltip-popover p {
  margin-top: 4px;
  color: var(--ink);
}

.tooltip-popover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.tooltip-popover-close:hover,
.tooltip-popover-close:focus-visible {
  background: var(--soft);
  color: var(--ink);
}

.assistant-panel {
  position: sticky;
  top: 22px;
  padding: 12px;
  background: transparent;
  border-color: transparent;
}

.tip-card {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.tip-card h4,
.tip-card p {
  margin: 0;
}

.tip-card p {
  color: var(--muted);
  margin-top: 4px;
}

.tooltip-dot {
  width: 26px;
  height: 26px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--teal);
  font-weight: 800;
}

.selected-summary {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-list.empty {
  display: block;
  color: var(--muted);
}

.chip {
  padding: 6px 8px;
  background: var(--soft);
  color: #155356;
  font-weight: 700;
}

.chip.needs-work {
  background: var(--amber-soft);
  color: #7c4c0a;
}

.review-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.review-card {
  border: 1px solid var(--line);
  padding: 16px;
  background: #fff;
}

.review-card span {
  font-size: 30px;
  font-weight: 800;
  color: var(--ink);
}

.review-card p {
  margin: 4px 0 0;
  color: var(--muted);
}

.validation-list {
  display: grid;
  gap: 10px;
}

.validation-item {
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
}

.validation-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.validation-item.blocked {
  border-color: #f0b5ad;
  background: #fff;
  border-left: 3px solid var(--red);
}

.validation-item.ok {
  border-color: var(--line);
  background: #fff;
  border-left: 3px solid var(--teal);
}

.admin-panel {
  display: grid;
  gap: 14px;
}

.admin-stage-list {
  display: grid;
  gap: 14px;
}

/* Monitor de cuentas conectadas. Va arriba del panel porque es lo unico que
   cambia solo mientras la administracion mira la pagina. */
.admin-sesiones {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
}

.admin-sesiones-titulo {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}

.admin-sesiones-titulo strong {
  font-size: 20px;
  letter-spacing: 0;
  color: var(--ink);
}

.admin-sesiones-titulo small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.admin-sesiones-vacio {
  font-size: 13px;
  color: var(--muted);
}

.admin-sesiones-lista {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 6px;
}

.admin-sesiones-lista li {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  background: var(--soft);
  border-left: 3px solid #b6c3c6;
  font-size: 13px;
}

/* Dos personas dentro de la misma cuenta es el caso que conviene mirar. */
.admin-sesiones-lista li.multiple {
  background: var(--amber-soft);
  border-left-color: var(--amber);
}

.admin-sesiones-dep {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 700;
  color: var(--ink);
}

.admin-sesiones-n {
  font-weight: 700;
  white-space: nowrap;
  color: var(--teal);
}

.admin-sesiones-lista li.multiple .admin-sesiones-n {
  color: var(--amber);
}

.admin-sesiones-hora {
  font-size: 11px;
  white-space: nowrap;
  color: var(--muted);
}

.admin-sesiones-aviso {
  margin: 0;
  padding: 10px 12px;
  background: var(--amber-soft);
  border-left: 3px solid var(--amber);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink);
}

/* Punto verde/rojo de conexion, reutilizado tanto en la vista normal (cuentas
   del propio equipo) como en el panel de administracion (todas las cuentas). */
.cuenta-punto {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
}

.cuenta-punto i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  flex: none;
}

.cuenta-punto.conectada i {
  background: #1a7f37;
}

/* En "Cuentas del equipo" cada punto puede traer, debajo del usuario, en que
   actividad esta esa sesion — dos lineas en vez de una sola. */
.equipo-cuentas-lista .cuenta-punto {
  align-items: flex-start;
  white-space: normal;
}

.equipo-cuentas-lista .cuenta-punto i {
  margin-top: 4px;
}

.cuenta-punto small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
}

.admin-cuentas-lista {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.admin-cuentas-lista li {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 7px 10px;
  background: var(--soft);
  border-left: 3px solid #b6c3c6;
  font-size: 13px;
}

.admin-cuentas-dep {
  flex: 1 1 200px;
  min-width: 0;
  font-weight: 700;
  color: var(--ink);
}

.admin-cuentas-puntos {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  flex: 2 1 300px;
}

.equipo-cuentas {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.equipo-cuentas-titulo {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}

.equipo-cuentas-lista {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.admin-dashboard {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.admin-summary-card,
.admin-next-action,
.admin-progress-table {
  background: #fff;
  border: 1px solid var(--line);
  padding: 14px;
}

.admin-summary-card span,
.admin-summary-card small {
  display: block;
  color: var(--muted);
}

.admin-summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
  color: var(--ink);
}

.admin-next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.admin-next-action p {
  margin: 0;
  color: var(--muted);
  max-width: 560px;
}

.admin-progress-table {
  overflow-x: auto;
}

.admin-progress-table table {
  width: 100%;
  border-collapse: collapse;
}

.admin-progress-table th,
.admin-progress-table td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.admin-progress-table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.admin-progress-table td small {
  display: block;
  color: var(--muted);
  margin-top: 2px;
}

.admin-progress-status {
  display: inline-block;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 800;
  background: #fff4db;
  color: #8a5b00;
}

.admin-progress-status.complete {
  background: #eef6f4;
  color: var(--teal);
}

.admin-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-actions-cell button {
  width: auto;
  white-space: nowrap;
}

.admin-stage-toggle {
  width: auto;
  min-width: 145px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid transparent;
  text-align: left;
}

.admin-stage-toggle span,
.admin-stage-toggle strong {
  display: block;
}

.admin-stage-toggle span {
  font-weight: 800;
}

.admin-stage-toggle strong {
  font-size: 12px;
}

.admin-stage-toggle.active {
  background: #e8f5ef;
  border-color: #9ed7bd;
  color: #17613f;
}

.admin-stage-toggle.inactive {
  background: #fff0ee;
  border-color: #e7aaa3;
  color: #9d2f24;
}

.admin-stage-toggle:disabled {
  opacity: 0.65;
  cursor: wait;
}

.admin-delete-cell {
  white-space: nowrap;
}

/* --- Barra de filtro del panel de administracion -------------------------- */

.admin-summary-card.alert {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
}

.admin-search {
  display: grid;
  gap: 4px;
  flex: 1 1 260px;
  min-width: 0;
}

.admin-search span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.admin-search input {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
}

.admin-toggle-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  min-height: 36px;
}

.admin-toolbar-count {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
  min-height: 36px;
  display: flex;
  align-items: center;
}

/* --- Panel de reparacion --------------------------------------------------- */

.admin-progress-table tr.has-issues td {
  background: var(--amber-soft);
}

.admin-progress-table tr.is-open td {
  border-bottom: none;
}

.admin-issue-flag {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--amber);
}

.admin-repair-row td {
  background: var(--soft);
  padding: 0;
}

.admin-repair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  padding: 16px;
  border-top: 2px solid var(--teal);
}

.admin-repair-block {
  display: grid;
  align-content: start;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 12px;
}

.admin-repair-block.danger {
  border-color: var(--red);
  /* Ocupa la fila completa: las tres opciones se comparan entre si, y en una
     sola columna estrecha quedaban una debajo de otra sin poder contrastarlas. */
  grid-column: 1 / -1;
}

.admin-repair-block h4 {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--teal);
}

.admin-repair-block.danger h4 {
  color: var(--red);
}

.admin-repair-note {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.admin-repair-ok {
  margin: 0;
  font-size: 12px;
  color: var(--teal);
}

.admin-issue-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  color: var(--ink);
}

.admin-repair-facts {
  margin: 0;
  display: grid;
  gap: 4px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.admin-repair-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.admin-repair-facts dt {
  color: var(--muted);
}

.admin-repair-facts dd {
  margin: 0;
  font-weight: 700;
}

.admin-repair-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.admin-repair-inline label {
  display: grid;
  gap: 4px;
  flex: 1 1 160px;
  min-width: 0;
}

.admin-repair-inline label span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.admin-repair-inline select {
  min-height: 38px;
  padding: 0 8px;
  border: 1px solid var(--line);
  background: #fff;
  width: 100%;
}

/* Bloques que necesitan el ancho completo de la fila: el listado de registros
   con problemas se lee como texto, no como tarjeta angosta. */
.admin-repair-block.wide {
  grid-column: 1 / -1;
}

.admin-detail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

/* En bloque y no en rejilla: la plantilla deja saltos de linea entre los span y
   una rejilla los convierte en celdas vacias que abren huecos. */
.admin-detail-list li {
  padding: 8px 10px;
  background: var(--soft);
  border-left: 3px solid var(--amber);
}

.admin-detail-list li > span {
  display: block;
}

.admin-detail-list li > span + span {
  margin-top: 3px;
}

.admin-detail-list li > span.admin-detail-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
}

.admin-detail-head em {
  font-style: normal;
  color: var(--muted);
  font-size: 12px;
}

.admin-detail-missing,
.admin-detail-finding {
  font-size: 12px;
  line-height: 1.5;
}

.admin-detail-missing b,
.admin-detail-finding b {
  color: var(--amber);
}

.admin-detail-finding {
  color: var(--red);
}

.admin-detail-finding b {
  color: var(--red);
}

/* Accion secundaria dentro de un bloque: no compite con el boton principal. */
.link-button {
  justify-self: start;
  min-height: 0;
  padding: 2px 0;
  border: none;
  background: none;
  color: var(--teal);
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.link-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

#adminExportAll {
  min-height: 36px;
}

.admin-repair-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: stretch;
  gap: 8px;
}

/* Cada opcion destructiva declara en el propio boton que conserva y que borra:
   la etiqueta sola no alcanza para decidir cual es la correcta. */
.admin-repair-options .danger-button {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  min-height: 0;
  white-space: normal;
}

.admin-repair-options .danger-button strong {
  font-size: 13px;
}

.admin-repair-options .danger-button small {
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

.admin-repair-options .danger-button:disabled small {
  color: var(--muted);
}

.small {
  font-size: 12px;
}

/* Refinamiento visual transversal y tabla funcional de la etapa 3. */
body {
  background: #f2f5f6;
}

button,
input,
select,
textarea,
.main-panel,
.login-card,
.login-aside,
.family-card,
.function-card,
.review-card,
.hint-box,
.identity-panel,
.coverage-card,
.release-card {
  border-radius: 6px;
}

button,
input,
select,
textarea {
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(37, 102, 106, 0.14);
}

.sidebar {
  padding: 8px 12px;
  grid-template-columns: 205px minmax(240px, 1fr) minmax(410px, auto) minmax(190px, 230px);
  box-shadow: 0 1px 8px rgba(31, 41, 51, 0.06);
}

.sidebar .release-card {
  display: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: var(--teal-soft);
  border-color: #cfe2e1;
  border-radius: 6px;
}

.step-button {
  border-radius: 6px;
}

.step-button.active {
  box-shadow: inset 0 -3px var(--teal);
}

.meter {
  border-radius: 4px;
}

.app-shell {
  padding: 16px 18px 24px;
}

.main-panel {
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(31, 41, 51, 0.07);
}

.section-heading {
  padding: 4px 0 14px;
}

.section-heading h3 {
  font-size: 20px;
  letter-spacing: 0;
}

.primary-button,
.ghost-button,
.danger-button {
  border-radius: 6px;
}

.check-option {
  border-radius: 5px;
}

.family-step-card {
  border-top: 3px solid var(--teal);
  box-shadow: 0 3px 12px rgba(31, 41, 51, 0.06);
}

.function-card:hover,
.check-option:hover {
  background: #f6faf9;
}

.app-container[data-view="detalle"] .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.app-container[data-view="detalle"] .assistant-panel {
  display: none;
}

#detalle.view {
  padding: 0;
}

#detalle > .section-heading {
  margin: 0;
  padding: 17px 20px;
  background: #fff;
}

.detail-table-layout {
  display: block;
  background: #f4f7f8;
}

.detail-function-header {
  display: grid;
  grid-template-columns: 66px minmax(320px, 1fr) 180px 410px;
  gap: 16px;
  align-items: center;
  min-height: 118px;
  margin: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 7px;
  box-shadow: 0 3px 12px rgba(31, 41, 51, 0.07);
}

.detail-function-number {
  display: grid;
  place-items: center;
  align-content: center;
  width: 66px;
  height: 74px;
  color: #fff;
  background: #24485a;
  border-radius: 6px;
}

.detail-function-number span {
  font-size: 9px;
  font-weight: 800;
}

.detail-function-number strong {
  margin-top: 2px;
  font-size: 27px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.detail-function-copy {
  min-width: 0;
}

.detail-function-copy h4 {
  display: -webkit-box;
  overflow: hidden;
  margin: 5px 0 6px;
  font-size: 17px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.detail-function-copy > p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.detail-function-progress {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.detail-function-progress > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--teal);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-function-progress > div:first-child strong {
  font-size: 16px;
}

.detail-function-progress small {
  color: var(--muted);
  font-size: 11px;
}

/* El selector de actividad es el control que mas se usa y el que menos se veia:
   estaba al mismo nivel visual que el resto de la cabecera. Se le da marco,
   fondo propio y un contador, para que se lea como control y no como adorno. */
.detail-function-select {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 8px;
  padding: 9px 11px 10px;
  background: var(--teal-soft);
  border: 2px solid var(--teal);
  border-radius: 8px;
}

.detail-function-select label {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}

.detail-function-select label em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  white-space: nowrap;
}

.detail-function-select select {
  min-width: 0;
  height: 40px;
  background: #fff;
  border: 1.5px solid var(--teal);
  font-weight: 700;
  color: var(--ink);
}

.detail-function-select select:focus-visible {
  outline: 3px solid rgba(37, 102, 106, 0.35);
  outline-offset: 1px;
}

.detail-function-nav {
  display: flex;
  gap: 5px;
}

.detail-function-nav button {
  min-width: 92px;
  padding: 8px;
  background: #fff;
}

.detail-function-nav button:not(:disabled):hover {
  background: var(--teal);
  color: #fff;
}

.detail-table-workspace {
  margin: 0 14px 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 3px 12px rgba(31, 41, 51, 0.07);
}

.detail-group-toolbar {
  display: grid;
  grid-template-columns: minmax(720px, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 13px 16px 0;
  border-bottom: 1px solid var(--line);
}

.detail-group-toolbar > .primary-button {
  margin-bottom: 9px;
}

.detail-group-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 4px;
  margin-top: 8px;
}

.detail-group-tab {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 8px 0 10px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 3px solid transparent;
  border-radius: 6px 6px 0 0;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-group-tab:hover {
  color: var(--ink);
  background: #f4f7f8;
}

.detail-group-tab.active {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: #d3e5e4;
  border-bottom-color: var(--teal);
}

.detail-group-tab span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 5px;
  background: #e8eef0;
  font-size: 10px;
}

.detail-group-tab.active span {
  color: #fff;
  background: var(--teal);
}

/* Los bloques ya recorridos quedan marcados: la barra funciona como un avance,
   no como seis pestañas sueltas. */
.detail-group-tab.visitado span {
  color: #fff;
  background: #9db9b8;
}

/* Cheurón de continuidad. Se omite al final de cada fila de la rejilla, donde
   no hay una pestaña a la derecha a la cual apuntar. */
.detail-group-tab::after {
  content: "\203A";
  margin-left: auto;
  padding-left: 8px;
  font-size: 15px;
  line-height: 1;
  color: #b6c3c6;
}

.detail-group-tab:nth-child(5n)::after,
.detail-group-tab:last-child::after {
  content: none;
}

/* Barra de avance bajo la tabla: es donde queda la vista despues de responder
   el ultimo campo de un bloque. */
.detail-block-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 14px;
  background: var(--soft);
  border-top: 1px solid var(--line);
}

.detail-block-position {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}

.detail-block-position strong {
  font-size: 14px;
  color: var(--ink);
}

.detail-block-position em {
  font-style: normal;
  font-weight: 700;
  color: var(--teal);
}

.detail-block-nav .ghost-button,
.detail-block-nav .primary-button {
  min-height: 40px;
  padding: 0 16px;
  white-space: nowrap;
}

.detail-group-help {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 16px;
  color: #465d6a;
  background: var(--blue-soft);
  border-bottom: 1px solid var(--line);
}

.detail-group-help span {
  color: var(--muted);
  white-space: nowrap;
}

.detail-table-scroll {
  max-height: calc(100vh - 390px);
  min-height: 360px;
  overflow: auto;
}

.detail-table-scroll.has-more-right {
  box-shadow: inset -16px 0 13px -13px rgba(31, 41, 51, 0.42);
}

.detail-table-scroll.has-more-left.has-more-right {
  box-shadow: inset 16px 0 13px -13px rgba(31, 41, 51, 0.28),
              inset -16px 0 13px -13px rgba(31, 41, 51, 0.42);
}

.detail-table-scroll.has-more-left:not(.has-more-right) {
  box-shadow: inset 16px 0 13px -13px rgba(31, 41, 51, 0.28);
}

.detail-scroll-hint {
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 11px;
  font-weight: 700;
}

.detail-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.detail-table th,
.detail-table td {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.detail-table th:last-child,
.detail-table td:last-child {
  border-right: 0;
}

.detail-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

.detail-table th {
  height: 56px;
  padding: 9px 10px;
  color: #36505e;
  background: #eaf0f2;
  font-size: 11px;
  line-height: 1.25;
}

.detail-table td {
  height: 84px;
  padding: 9px 10px;
  background: #fff;
}

.detail-table tbody tr:nth-child(even) td {
  background: #fcfdfd;
}

.detail-table tbody tr:hover td {
  background: #f7fbfb;
}

.detail-table th:first-child,
.detail-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
}

.detail-table th:first-child {
  z-index: 7;
  background: #e1eaed;
}

.detail-table td:first-child {
  background: #f8fbfb;
}

/* El carril del dato es la unica columna fija: aqui viven tambien el estado de
   la fila y el atajo de propagacion, que antes ocupaban las dos ultimas columnas
   y solo eran alcanzables en pantallas de 1920px o mas. */
.detail-data-column {
  width: 236px;
}

.detail-data-column strong {
  display: block;
  margin-bottom: 6px;
}

.detail-data-tag {
  display: inline-block;
  padding: 3px 6px;
  color: var(--teal);
  background: var(--teal-soft);
  border: 1px solid #d3e5e4;
  border-radius: 4px;
  font-size: 10px;
}

td.detail-data-column .detail-row-status {
  display: flex;
  margin-top: 9px;
}

td.detail-data-column small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

td.detail-data-column .detail-copy-row {
  width: 100%;
  min-height: 30px;
  margin-top: 9px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 700;
}

.detail-table th:not(.detail-data-column),
.detail-answer-cell {
  width: 230px;
}

.detail-answer-cell {
  position: relative;
  padding-bottom: 32px !important;
}

.detail-answer-button {
  display: -webkit-box;
  width: 100%;
  min-height: 40px;
  padding: 7px 8px;
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b7c5cc;
  border-radius: 6px;
  text-align: left;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.detail-answer-button.empty {
  color: #71828d;
  background: #fbfcfc;
  border-style: dashed;
}

.detail-answer-button:hover {
  background: #f4faf9;
  border-color: var(--teal);
  box-shadow: 0 2px 7px rgba(31, 41, 51, 0.08);
}

.detail-repeat-button {
  position: absolute;
  right: 9px;
  bottom: 6px;
  min-height: 22px;
  padding: 0 6px;
  color: var(--teal);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.5;
}

.detail-answer-cell:hover .detail-repeat-button:not(:disabled),
.detail-repeat-button:focus-visible {
  opacity: 1;
}

.detail-repeat-button:hover {
  background: var(--teal-soft);
}

.detail-repeat-button:disabled {
  color: #9ba9b0;
  cursor: default;
  opacity: 0.25;
}

.detail-answer-cell.readonly,
.detail-answer-cell.not-applicable {
  padding-bottom: 9px !important;
  /* Señala que la celda explica su motivo al pasar el cursor. */
  cursor: help;
}

.detail-readonly-answer,
.detail-answer-cell.not-applicable span {
  display: block;
  padding: 8px;
  color: var(--teal);
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
  border-radius: 0 5px 5px 0;
  font-size: 11px;
  font-weight: 700;
}

.detail-answer-cell.not-applicable span {
  color: var(--muted);
  background: #f1f4f5;
  border-left-color: #a9b5bb;
}

.detail-row-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 800;
}

.detail-row-status::before {
  width: 8px;
  height: 8px;
  background: #aab7bd;
  border-radius: 50%;
  content: "";
}

.detail-row-status.progress::before {
  background: var(--amber);
}

.detail-row-status.complete::before {
  background: #23744b;
}

.detail-row-status.legal-gap {
  color: #8a4b12;
}

/* Hallazgo: la fila está completa pero declara que no hay norma habilitante. */
.detail-row-status.no-basis {
  color: var(--red);
}

.detail-row-status.no-basis::before {
  background: var(--red);
}

.detail-row-status.legal-gap::before {
  background: #c2661b;
}

.detail-status-column small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.detail-copy-row {
  width: 100%;
  padding: 7px;
  font-size: 10px;
}

.detail-table-footer {
  display: flex;
  gap: 5px;
  padding: 10px 16px;
  color: var(--muted);
}

.detail-footer-progress {
  margin-left: auto;
}

.detail-editor-dialog {
  width: min(680px, calc(100vw - 40px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(31, 41, 51, 0.22);
}

.detail-editor-dialog::backdrop {
  background: rgba(20, 33, 43, 0.52);
}

.detail-editor-panel {
  margin: 0;
}

.detail-editor-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.detail-editor-heading h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.detail-editor-close {
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 25px;
}

.detail-editor-help {
  margin: 0;
  padding: 14px 20px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* El ejemplo se separa de la instruccion: antes iban concatenados en un solo
   parrafo gris de cuatro lineas donde no se distinguia uno de otro. */
.detail-editor-example {
  display: block;
  margin-top: 8px;
  padding-left: 10px;
  border-left: 2px solid var(--line);
  color: var(--ink);
}

.detail-editor-control {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 420px);
  padding: 16px 20px;
  overflow: auto;
}

/* Rejilla de dos columnas: el control ocupa siempre el mismo ancho, de modo que
   los títulos de todas las opciones arrancan en la misma vertical aunque la
   ayuda de cada una tenga distinto largo. */
/* La alternativa excluyente se separa del resto: no es una mas de la lista,
   es la que anula a las demas. */
.detail-editor-option.excluyente {
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.detail-editor-option.excluyente strong {
  color: var(--amber);
}

/* El buscador queda fijo arriba: la lista se desplaza debajo de el y el campo
   sigue a la vista mientras se filtra. */
.detail-editor-search {
  position: sticky;
  top: -16px;
  z-index: 2;
  display: grid;
  gap: 4px;
  margin: -16px -20px 2px;
  padding: 14px 20px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.detail-editor-search input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1.5px solid var(--teal);
  background: #fff;
  font-weight: 600;
}

.detail-editor-search input[type="search"]:focus-visible {
  outline: 3px solid rgba(37, 102, 106, 0.3);
  outline-offset: 1px;
}

.detail-editor-search-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.detail-editor-search-empty {
  margin: 4px 0;
  padding: 12px 14px;
  background: var(--soft);
  border-left: 3px solid var(--amber);
  font-size: 13px;
  color: var(--muted);
}

.detail-editor-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.detail-editor-option:hover {
  border-color: #bfd0dc;
  background: var(--soft);
}

/* La opción marcada debe distinguirse del simple paso del cursor. */
.detail-editor-option:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: inset 0 0 0 1px var(--teal);
}

.detail-editor-option:focus-within {
  outline: 2px solid rgba(37, 102, 106, 0.35);
  outline-offset: 1px;
}

.detail-editor-option input {
  margin-top: 2px;
}

.detail-editor-option > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

/* Peso explícito: <strong> resuelve «bolder» contra el 700 que hereda del
   <label> y terminaba en 900, demasiado pesado para un listado largo. */
.detail-editor-option strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
}

/* font-weight explícito: el contenedor es un <label>, que hereda negrita, y sin
   esto la ayuda pesaba igual que el título y anulaba la jerarquía. */
.detail-editor-option small {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.45;
}

.detail-editor-control textarea,
.detail-editor-control input[type="text"] {
  width: 100%;
  min-height: 44px;
  padding: 10px;
}

.detail-editor-control textarea {
  min-height: 130px;
  resize: vertical;
}

.detail-editor-custom,
.detail-editor-dependent {
  display: grid;
  gap: 7px;
  margin-top: 2px;
  padding: 12px;
  background: #f4f9f8;
  border-left: 3px solid var(--teal);
}

.detail-editor-custom[hidden],
.detail-editor-dependent[hidden] {
  display: none;
}

.detail-editor-custom label,
.detail-editor-dependent label,
.detail-duration-editor label {
  font-weight: 700;
}

.detail-editor-custom small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.detail-structured-options {
  display: grid;
  gap: 8px;
}

.detail-duration-editor {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(180px, 1fr);
  gap: 12px;
}

.detail-duration-editor > div {
  display: grid;
  gap: 7px;
}

.detail-editor-custom input,
.detail-editor-dependent input,
.detail-editor-dependent select,
.detail-duration-editor input,
.detail-duration-editor select {
  width: 100%;
}

.detail-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1250px) {
  .detail-function-header {
    grid-template-columns: 66px minmax(280px, 1fr) 170px;
  }

  .detail-function-select {
    grid-column: 2 / -1;
  }

  .detail-group-toolbar {
    grid-template-columns: 1fr;
  }

  .detail-block-nav {
    justify-content: center;
  }

  .detail-block-position {
    order: -1;
    flex: 1 1 100%;
  }

  .detail-group-toolbar > .primary-button {
    justify-self: end;
  }
}

/* ---------------------------------------------------------------------------
   Adaptacion a pantallas angostas.
   Van al FINAL del archivo a proposito: la capa de rediseno anterior declara
   reglas sin media query (por ejemplo la rejilla de .sidebar) que, por estar
   despues, anulaban estas y dejaban la barra con un minimo de 1045px en todos
   los anchos. Cualquier regla responsiva nueva debe agregarse aqui abajo.
   Orden de mayor a menor ancho para que el breakpoint mas estrecho gane.
   --------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .sidebar {
    position: static;
    width: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .brand,
  .steps {
    grid-column: 1 / -1;
  }

  .steps {
    flex-wrap: wrap;
  }

  .app-shell {
    margin-left: 0;
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .assistant-panel {
    position: static;
  }

  .admin-dashboard {
    grid-template-columns: 1fr;
  }

  .admin-next-action {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .detail-duration-editor {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .brand,
  .steps {
    grid-column: auto;
  }

  #releaseStatus {
    grid-template-columns: minmax(0, 1fr);
  }

  .release-item + .release-item {
    padding-top: 8px;
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .topbar,
  .section-heading,
  .top-actions {
    display: grid;
  }

  .split-row,
  .field-grid,
  .review-grid,
  .data-options,
  .multi-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-shell {
    padding: 12px;
  }
}

/* Editor estructurado de la ubicación en la nube: proveedor, país y región. */
.structured-editor {
  display: grid;
  gap: 14px;
}

.structured-editor > div {
  display: grid;
  gap: 5px;
}

.structured-editor label {
  font-size: 12.5px;
  color: var(--ink);
}

.detail-optional {
  color: var(--muted);
  font-weight: 400;
}

/* Aviso cuando había una respuesta antigua escrita a mano que se va a reemplazar. */
.detail-legacy-note {
  padding: 11px 13px;
  border-left: 3px solid var(--amber);
  background: var(--amber-soft);
  border-radius: 0 4px 4px 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ink);
}
