
.route-card{
  border-radius:16px; background:#fff;
  box-shadow:0 4px 10px rgba(0,0,0,.08),0 8px 24px rgba(0,0,0,.06);
  transition:box-shadow .2s ease-in-out; position:relative;
}
.route-card:hover{ box-shadow:0 6px 12px rgba(0,0,0,.12),0 12px 28px rgba(0,0,0,.10); z-index:3; }
.card.shadow-sm:hover{ box-shadow:0 6px 12px rgba(0,0,0,.12),0 12px 28px rgba(0,0,0,.10) !important; }
.route-card.is-dropdown-open{ z-index:1056; }
.dropdown-menu{ z-index:1060; box-shadow:0 6px 16px rgba(0,0,0,.12); }

.tiny{ font-size:.68rem; letter-spacing:.08em; }
.route-title-wrap{ flex:1 1 auto; min-width:0; }
.route-title{
  font-size:1.05rem; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical;
  overflow:hidden; white-space:normal; text-overflow:ellipsis; word-break:break-word; overflow-wrap:anywhere;
  font-weight:400;
}
.route-regs{ flex:0 0 auto; white-space:nowrap; }
.dropdown-item i.bi-play{ font-size:1.2rem; }

.plantillas-section{ background:#f5f6f8; padding:4px; border-radius:12px; }
.table.plantillas{
  --bs-table-bg:transparent; --bs-table-striped-bg:transparent; --bs-table-hover-bg:transparent;
  background:transparent !important; border-color:transparent;
}
.table.plantillas > :not(caption) > * > *{ background:transparent !important; box-shadow:none !important; border:0; }
#infoPlantillas tr, #infoPlantillas td{ background:transparent !important; border:0 !important; }

.min-w-0{ min-width:0 !important; }
.dropdown-menu.w-100{ min-width:100% !important; }

.dropzone{
  border:2px dashed #d0d7de; border-radius:12px; background:#fff; cursor:pointer;
  transition: box-shadow .18s ease, background-color .18s ease, border-color .18s ease;
}
.dropzone.dragover{ background:#f5f9ff; border-color:#0d6efd; box-shadow:0 0 0 3px rgba(13,110,253,.15); }

.card-file{ border:1px solid #e5e7eb; border-radius:10px; background:#fff; box-shadow:0 4px 12px rgba(16,24,40,.08); }
.card-file .card-body{
  position:relative; padding:6px 36px 6px 10px; display:flex; align-items:center; gap:8px;
}
.file-avatar{ width:40px; height:40px; border-radius:8px; background:#f3f4f6; display:grid; place-items:center; flex:0 0 40px; }
.file-avatar i{ font-size:25px; color:#6b7280; }
.card-file .fw-semibold{
  display:block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  font-size:1rem; font-weight:500;
}
.tpl-close{
  position:absolute; top:-10px; right:-10px; width:24px; height:24px; border:0; border-radius:999px;
  display:grid; place-items:center; background:#000; color:#fff; line-height:1; cursor:pointer;
  box-shadow:0 4px 12px rgba(16,24,40,.2);
}
.tpl-close:hover{ background:#f10808; }
.tpl-subtitle{ text-align:center; color:#6b7280; font-size:.85rem; }

#tabla-estructura td.editable .name-view{ display:inline; }
#tabla-estructura td.editable .name-input{ display:none; }
#tabla-estructura td.editable.editing .name-view{ display:none; }
#tabla-estructura td.editable.editing .name-input{
  display:block; width:100%; resize:none; border-radius:.375rem; border:1px solid #d0d7de;
  padding:.25rem .5rem; line-height:1.25rem; box-shadow:none; font-weight:600; font-size:1rem; color:#212529;
}
#tabla-estructura td.editable.editing .name-input:focus{
  border-color:#0d6efd; box-shadow:0 0 0 .15rem rgba(13,110,253,.25); outline:0;
}
#tabla-estructura td, #tabla-estructura th{ vertical-align:middle; }
#tabla-estructura tbody tr:hover{ background:#f9fafb; }
#tabla-estructura .drag-handle{ cursor:grab; user-select:none; width:36px; }
#tabla-estructura .form-check-input{ cursor:pointer; }
#tabla-estructura .btn-link{ line-height:1; }


#chips-evidencias{ padding:0; } 
.evi-chip{
  display:flex; align-items:center; gap:.5rem; padding:.35rem .5rem; border-radius:999px;
  background:#f3f4f6; border:1px solid #e5e7eb;
}
.evi-thumb i{ font-size:18px; color:#6b7280; }
.evi-name{ max-width:220px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.evi-close{
  width:20px; height:20px; border:0; border-radius:50%; display:flex; align-items:center; justify-content:center;
  background:#111; color:#fff; line-height:1; font-size:12px; cursor:pointer;
}
.evi-close:hover{ background:#e11d48; }

#modal-evid-resultados .table-responsive{ overflow-x:auto; overflow-y:visible; }
#modal-evid-resultados td .dropdown{ position:static; }
#modal-evid-resultados .dropdown-menu{ z-index:1080; }

#dz-evidencias{ display:grid; place-items:center; }
#dz-evidencias .fw-semibold{ text-align:center; }

.exp-card{
  background:#fff; border:1px solid #e5e7eb; border-radius:14px; box-shadow:0 6px 20px rgba(16,24,40,.06);
  overflow:hidden; transition:box-shadow .2s ease;
}
.exp-card:hover{ box-shadow:0 10px 28px rgba(16,24,40,.10); }
.exp-card-toolbar{ display:flex; gap:.5rem; justify-content:flex-end; padding:.35rem .5rem; }
.exp-card-toolbar .btn-icon{
  width:32px; height:32px; display:grid; place-items:center; border-radius:999px; border:0; background:#f3f4f6; color:#111827;
}
.exp-card-toolbar .btn-icon:hover{ background:#e5e7eb; }
.exp-card-preview{
  position:relative; aspect-ratio:4/3; background:#f8fafc; display:grid; place-items:center;
}
.exp-card-preview img, .exp-card-preview iframe{ width:100%; height:100%; object-fit:contain; border:0; }
.exp-card-preview .file-icon{ font-size:48px; color:#64748b; }
.exp-card-title{
  text-align:center; font-weight:600; letter-spacing:.02em; padding:.75rem .75rem 1rem; text-transform:uppercase;
}
.exp-prev-wrap{ min-height:60vh; display:grid; place-items:center; background:#0b0f19; }
.exp-prev-wrap img, .exp-prev-wrap iframe{ width:100%; height:80vh; object-fit:contain; background:#0b0f19; border:0; }

.evi-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:12px;
  justify-content:center;
}
@media (min-width:576px){
  .evi-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (min-width:992px){
  .evi-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); }
}

.evi-card{
  position:relative;
  width:100%; height:100%;
  border:1px solid #e5e7eb; border-radius:10px; background:#fff;
  padding:8px; box-shadow:0 4px 10px rgba(16,24,40,.06);
  display:flex; flex-direction:column; gap:6px;
  z-index:0;
  justify-content:center;
}

.evi-preview{
  position:relative; z-index:1;
  height:120px; background:#f8fafc;
  border:1px solid #e5e7eb; border-radius:8px;
  overflow:hidden; display:grid; place-items:center;
}
@media (min-width:992px){
  .evi-preview{ height:130px; }
}

.evi-preview img{
  width:100%; height:100%;
  object-fit:cover; border:0; position:relative; z-index:1;
}

.evi-preview--pdf{ overflow:auto; background:#fff; }
.evi-preview--pdf .evi-embed-pdf{
  width:100%; height:100%;
  border:0; object-fit:contain; pointer-events:auto; position:relative; z-index:1;
}

.evi-icon{ font-size:36px; color:#64748b; line-height:1; }

.evi-input{
  text-align:center; font-weight:500; font-size:.85rem;
  padding:.25rem .5rem; height:32px;
}


.evi-remove{
  position:absolute; top:-6px; right:-6px;
  width:24px; height:24px; border:0; border-radius:50%;
  background:#111; color:#fff; display:grid; place-items:center;
  line-height:1; font-size:12px; cursor:pointer;
  box-shadow:0 4px 10px rgba(0,0,0,.25); z-index:10;
}
.evi-remove:hover{ background:#e11d48; }

.swal-msg{
  margin:0 0 .5rem 0;
  color:#475569;
  font-size:1rem;
  text-align:center;
}
.swal-chip-wrap{
  display:flex; flex-wrap:wrap; gap:8px; justify-content:center;
}
.swal-chip{
  display:inline-block;
  padding:.35rem .65rem;
  border-radius:.25rem;
  background:#eef2f7; border:1px solid #dbe1e8;
  color:#111827; font-weight:600; font-size:.95rem;
}

.file-icons .icon-card{
  padding:.75rem; border:1px solid #e5e7eb; border-radius:.5rem; background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.05); display:flex; align-items:center; justify-content:center;
}
@media (max-width:576px){
  .file-icons .icon-card{ padding:.4rem; border:1px solid transparent; box-shadow:none; background:none; }
  .file-icons i{ font-size:1.5rem; }
}

.plantillas-section .table-responsive{ overflow:visible; }

#tabla-evid-structured tr.row-sent{ opacity:.65; }
#tabla-evid-structured tr.row-sent .btn,
#tabla-evid-structured tr.row-sent a{ pointer-events:none; }
.badge-sent{
  display:inline-block; padding:.25rem .5rem; border-radius:.375rem;
  background:#e7f5e9; color:#177245; font-weight:600; font-size:.8rem;
}

#tabla-estructura th:nth-child(3),
#tabla-estructura td:nth-child(3){
  text-align:center; vertical-align:middle; white-space:nowrap;
}

@media (max-width:767.98px){
  .oblig-th{ gap:.35rem; }
}

.btn-add-col{
  display:inline-flex; align-items:center; gap:.4rem;
  border:1px solid #d0d7de; padding:.25rem .5rem; border-radius:.375rem; background:#fff;
}
@media (max-width:767.98px){
  .btn-add-col .txt{ display:none; }
}

#tabla-estructura tbody tr.row-flash{
  background:transparent !important;
  outline:3px solid rgba(var(--bs-primary-rgb), .9);
  outline-offset:-3px;
  animation:rowOutlineFade 1600ms ease-out 1;
}
.table-striped > tbody > tr.row-flash:nth-of-type(odd) > *{
  background-color:transparent !important;
}
@keyframes rowOutlineFade{
  0%{   outline-color:rgba(var(--bs-primary-rgb), .95); }
  60%{  outline-color:rgba(var(--bs-primary-rgb), .5); }
  100%{ outline-color:rgba(var(--bs-primary-rgb), 0); }
}

#exp-status-strip.exp-strip{ display:block; grid-template-columns:initial; gap:0; }

#exp-status-strip{
  box-sizing:border-box;
  padding:.75rem .75rem;
  margin-bottom:1rem;
  background:#f8f9fa;
  border:1px dashed #dee2e6;
  border-radius:.75rem;
}

#exp-status-strip .exp-legend{
  display:flex; align-items:center; justify-content:center;
  gap:18px; flex-wrap:wrap;
  padding:.25rem .5rem;
  margin-bottom:.6rem;
  background:#eef2f7;
  border:1px solid #e5e7eb;
  border-radius:9999px;
  font-size:.9rem; line-height:1; color:#374151;
}
#exp-status-strip .exp-legend span{ display:inline-flex; align-items:center; gap:6px; }

#exp-status-strip .exp-grid-wrap{
  --grid-max-h: clamp(180px, 42vh, 360px);
  max-height: var(--grid-max-h);
  overflow:auto;
  padding-right:.25rem;
  border-radius:.5rem;
}
#exp-status-strip .exp-grid-wrap::-webkit-scrollbar{ width:8px; }
#exp-status-strip .exp-grid-wrap::-webkit-scrollbar-thumb{ background:rgba(0,0,0,.15); border-radius:6px; }

#exp-status-strip .exp-grid{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:.5rem;
}
@media (max-width:1200px){ #exp-status-strip .exp-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (max-width:768px){  #exp-status-strip .exp-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); } }
@media (max-width:360px){  #exp-status-strip .exp-grid{ grid-template-columns:1fr; } }

#exp-status-strip .exp-pill{
  display:flex; align-items:center; gap:.5rem;
  width:100%; box-sizing:border-box;
  padding:.35rem .6rem;
  border:1px solid #e5e7eb; border-radius:9999px;
  background:#f8fafc; line-height:1; min-height:36px;
}
@media (max-width:480px){
  #exp-status-strip .exp-pill{ gap:.4rem; padding:.32rem .5rem; min-height:34px; }
}

#exp-status-strip .exp-pill i,
#exp-status-strip .exp-pill .spinner-border{ vertical-align:middle; }
#exp-status-strip .exp-pill .spinner-border{ width:.9rem; height:.9rem; }

#exp-status-strip .is-ok{  color:#198754; }
#exp-status-strip .is-warn{color:#f9a825; }
#exp-status-strip .is-err{ color:#dc3545; }

#exp-status-strip .exp-pill .label{ font-weight:500; flex:0 0 auto; white-space:nowrap; }
#exp-status-strip .exp-pill .sep{ width:1px; height:16px; background:#e9ecef; margin:0 .1rem; flex:0 0 auto; }
#exp-status-strip .exp-pill .file-name{
  flex:1 1 auto; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#3a3a3a;
}

#exp-status-strip .exp-pill .btn-retry{
  display:inline-flex; align-items:center; gap:.3rem;
  background:none; border:0; padding:0; line-height:1;
  color:#0d6efd; cursor:pointer; font-size:.75rem;
}
#exp-status-strip .exp-pill .btn-retry:hover{ text-decoration:underline; }
@media (min-width:992px){  #exp-status-strip .btn-retry-icon{ display:none; }  #exp-status-strip .btn-retry-text{ display:inline; } }
@media (max-width:991.98px){ #exp-status-strip .btn-retry-icon{ display:inline; font-size:1.1rem; } #exp-status-strip .btn-retry-text{ display:none; } }

#exp-status-strip .exp-pill .actions{
  margin-left:auto;
  display:flex; align-items:center;
}

#exp-status-strip .pill-remove{
  --sz:.9rem;                   
  position:static !important;   
  flex:0 0 var(--sz);
  width:var(--sz); height:var(--sz);
  margin-left:.25rem;
  border:0; border-radius:50%;
  background:#0b1220; color:#fff;
  display:none;                 
  align-items:center; justify-content:center;
  line-height:1; box-shadow:0 2px 6px rgba(0,0,0,.25);
  cursor:pointer; font-size:calc(var(--sz)*.6);
}
#exp-status-strip .pill-remove:hover{ background:#dc3545; transform:scale(1.03); }
#exp-status-strip .pill-remove:focus{ outline:none; }

#exp-status-strip .exp-pill[data-finished="1"] .pill-remove{
  display:inline-flex;
}

#exp-status-strip .exp-pill i,
#exp-status-strip .exp-pill .spinner-border{ vertical-align:middle; }

.cfg-card{
  border-radius:14px; border:1px solid #e5e7eb; box-shadow:0 8px 24px rgba(16,24,40,.08);
}

.cfg-section{ 
  border:1px dashed #dee2e6; border-radius:.75rem; padding:.75rem .9rem; margin-bottom:1rem; background:#f8f9fa;
}
.cfg-section-title{
  font-weight:600; margin-bottom:.5rem; color:#111827;
}

.cfg-mode-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); }
@media (max-width: 768px){ .cfg-mode-grid{ grid-template-columns:1fr; } }

.cfg-radio{ margin:0; }
.cfg-radio input{ display:none; }
.cfg-radio .cfg-radio-box{
  display:flex; gap:.75rem; align-items:flex-start; 
  border:1px solid #e5e7eb; border-radius:.75rem; background:#fff; padding:.75rem .9rem;
  transition: box-shadow .18s ease, border-color .18s ease, background-color .18s ease;
  cursor:pointer;
}
.cfg-radio .cfg-radio-box i{ font-size:1.25rem; color:#0d6efd; margin-top:.1rem; }
.cfg-radio .cfg-radio-box .title{ font-weight:600; }
.cfg-radio .cfg-radio-box .hint{ color:#6b7280; font-size:.9rem; }
.cfg-radio input:checked + .cfg-radio-box{
  border-color:#0d6efd; box-shadow:0 0 0 3px rgba(13,110,253,.15);
}

#cfgGroupBy{ min-height: 2.8rem; }

#btnCfgGuardar i{ margin-right:.25rem; }

:root{
  --toast-bg: rgba(0, 123, 150, .90);
  --toast-bg-hover: rgba(0, 123, 150, 1);
  --toast-text: #fff;
  --tpl-success: #198754;   
  --tpl-warn:    #f59e0b;   
  --tpl-error:   #dc3545;   
  --tpl-spin-track: rgba(33,37,41,.25);
  --tpl-spin-head:  #212529;
}

#global-toast{
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 1080; background: var(--toast-bg); color: var(--toast-text);
  border-radius: 12px; box-shadow: 0 8px 20px rgba(0,0,0,.2);
  overflow: hidden; animation: toast-in .22s ease-out; transition: background .2s ease;
  min-width: 280px; max-width: min(92vw, 500px); pointer-events: auto; display: none;
}
#global-toast.show{ display:block }
#global-toast:hover{ background: var(--toast-bg-hover) }
#global-toast .gt-row{ display:flex; gap:.6rem; align-items:flex-start; padding:.7rem 1rem .8rem }
#global-toast .gt-ico{
  flex:0 0 auto; display:inline-flex; width:28px; height:28px; border-radius:8px;
  align-items:center; justify-content:center; background:rgba(255,255,255,.18); font-size:17px;
}
#global-toast .gt-title{ font-weight:700; margin:.05rem 0 .2rem; font-size:15px }
#global-toast .gt-text{ opacity:.97; line-height:1.3; font-size:14px }
#global-toast .gt-actions{ margin-top:.5rem }
#global-toast .gt-btn{ background:#fff; color:#0d6efd; border:0; border-radius:8px; padding:.3rem .8rem; font-weight:600; font-size:14px }
#global-toast .gt-close{ position:absolute; top:6px; right:8px; background:transparent; border:0; color:#fff; opacity:.85; font-size:16px }
@keyframes toast-in{ from{transform:translate(-50%,-10px);opacity:0} to{transform:translate(-50%,0);opacity:1} }

.route-card{ position: relative; }

.tpl-badge{
  position:absolute; top:-8px; right:-8px;
  width:22px; height:22px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:#fff; box-shadow:0 4px 12px rgba(0,0,0,.14); z-index:1;
}

.tpl-badge--loading{ background:#fff; color:#212529; }
.tpl-badge--loading .tpl-spin{
  width:12px; height:12px; border-radius:50%;
  border:2px solid var(--tpl-spin-track);
  border-top-color:var(--tpl-spin-head);
  animation:tpl-spin .7s linear infinite;
}
@keyframes tpl-spin{ to{ transform: rotate(360deg) } }

.tpl-badge--success{ background: var(--tpl-success); box-shadow:0 4px 12px rgba(25,135,84,.35) }
.tpl-badge--success i{ font-size:13px; line-height:1 }

.tpl-badge--warn{ background: var(--tpl-warn); box-shadow:0 4px 12px rgba(245,158,11,.35) }
.tpl-badge--warn i{ font-size:13px; line-height:1 }

.tpl-badge--error{ background: var(--tpl-error); box-shadow:0 4px 12px rgba(220,53,69,.35) }
.tpl-badge--error i{ font-size:13px; line-height:1 }


#tabla-estructura #oblig-master.form-check-input{
  box-shadow: none !important;
}

#tabla-estructura #oblig-master.form-check-input:not(:checked),
#tabla-estructura #oblig-master.form-check-input:indeterminate {
  background-color: #fff !important; 
  border-color: #dee2e6 !important;
  background-position: left center !important;
  box-shadow: none !important;
}

#tabla-estructura #oblig-master.form-check-input:indeterminate{
  background-color: #e9ecef !important;
  border-color: #e9ecef !important;
}


#tabla-estructura .form-switch #oblig-master.form-check-input:active,
#tabla-estructura .form-switch #oblig-master.form-check-input:focus {
  filter: none !important;
  outline: 0 !important;
}

.inline-help-switch .form-switch { padding-left: 0; }
.inline-help-switch .form-check-input { margin-left: 0; transform: translateY(1px); }
.inline-help-switch label { margin: 0 .25rem 0 .25rem; white-space: nowrap; }

.info-bubble{
  display:inline-grid; place-items:center;
  width:20px; height:20px; border-radius:999px;
  background:#eaf2ff; border:1px solid #cfe2ff; color:#0d6efd;
  line-height:1; font-size:12px;
}
.info-bubble:hover{ background:#e2edff; }
.info-bubble:focus{ outline:0; box-shadow:0 0 0 3px rgba(13,110,253,.2); }

.inline-help-switch{ margin-left:auto; }

.form-check.form-switch { padding-left: 0; }
.form-check.form-switch .form-check-input { margin-left: 0; }

/* Oculta SOLO el textarea cuando el maestro está OFF (layout intacto) */
#tabla-estructura.ctx-off td.ctx-cell .ctx-input { display: none; }
#tabla-estructura.ctx-off td.ctx-cell { padding-top: 0 !important; padding-bottom: 0 !important; }

/* Base limpio */
.ctx-input {
  width: 100%;
  background: transparent;
  border: 1px solid transparent;   /* ocupa espacio sin verse */
  outline: none;
  box-shadow: none;
  resize: none;
  padding: .25rem .5rem;
  min-height: 28px;
  border-radius: .5rem;
}

/* Placeholder suave */
.ctx-input::placeholder { opacity: .6; }


/* Hover: una pista leve, solo cuando está vacío */
.ctx-input:placeholder-shown:hover {
  border-bottom-color: #c6cdd5;
}

/* Contenedor relativo para posicionar el popover (igual) */
.ctx-help-wrap { position: relative; }

/* Mini panel tipo popover: ANCHO FIJO Y ANGOSTO */
.ctx-help-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;                 /* o right:0 si lo prefieres */
  z-index: 1050;

  /* ▶️ fuerza a crecer hacia ABAJO, no a lo ancho */
  width: 240px;            /* ajusta 200–280px a tu gusto */
  max-width: 240px;

  /* evita que ocupe todo el th */
  display: inline-block;
}

/* Tarjetita */
.ctx-help-card {
  position: relative;      /* necesario para la flechita ::before */
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  overflow: hidden;

  /* ▶️ que el texto se parta y baje en varias líneas */
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Flechita ↑ */
.ctx-help-card::before {
  content: "";
  position: absolute;
  top: -8px;
  left: 16px;                 /* mueve esto si cambias alineación */
  width: 16px; height: 16px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
  transform: rotate(45deg);
  box-shadow: -3px -3px 10px rgba(0,0,0,.05);
}

.ctx-help-body {
  padding: .75rem .85rem;
  color: #374151;
  font-size: .900rem;
  line-height: 1.35rem;
  font-weight: 400;
}

.ctx-help-wrap .bi-info-circle {
  color: #0d6efd;  /* este es el azul de Bootstrap, cámbialo por tu código exacto */
  font-size: 1rem; /* opcional, para igualar el estilo de tu captura */
}
/* Responsive: en móvil, alinéaló a la derecha si no cabe */
@media (max-width: 576px) {
  .ctx-help-popover { left: auto; right: 0; width: 220px; max-width: 220px; }
  .ctx-help-card::before { left: auto; right: 16px; }
}


   #modal-estructura-manual {

    /* Lista de tarjetas */
    .ms-list{
      display: grid;
      gap: 12px;
    }
  
    /* Tarjeta */
    .ms-card{
      background: #fff;
      border: 1px solid #e5e7eb;
      border-radius: 12px;
      padding: 12px;
      box-shadow: 0 2px 10px rgba(0,0,0,.06);
    }
  
    /* Cabecera de la tarjeta */
    .ms-head{
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 8px;
    }
    .ms-actions{
      display: flex;
      align-items: center;
      gap: .5rem;
    }
  
    /* Switches compactos */
    .ms-req-wrap,
    .ms-ctx-wrap{
      display: flex;
      align-items: center;
      gap: .5rem;
    }
    .ms-req-wrap .form-check-input,
    .ms-ctx-wrap .form-check-input{
      margin: 0; /* quita margen por defecto de Bootstrap */
    }
  
    /* Grid de inputs (nombre + contexto) */
    .ms-grid{
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      align-items: start;
      transition: grid-template-columns .12s ease;
    }
    /* Cuando hay contexto → 2 columnas (derecha) */
    .ms-card.has-ctx .ms-grid{
      grid-template-columns: 1fr 1fr;
    }
  
    /* Mostrar/ocultar bloque de contexto */
    .ctx-wrap{ display: none; }
    .ms-card.has-ctx .ctx-wrap{ display: block; }
  
    /* Mobile: apilar siempre */
    @media (max-width: 575.98px){
      .ms-grid{ grid-template-columns: 1fr !important; }
    }
  
    /* Botón eliminar deshabilitado (cuando queda 1) */
    .ms-del.disabled{
      opacity: .5;
      pointer-events: none;
    }
  }

/* Ajuste general de la cabecera */
#modal-estructura-manual .ms-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  flex-wrap: wrap;  /* 👈 permite que baje en pantallas estrechas */
}

/* Sección izquierda y derecha */
#modal-estructura-manual .ms-req-wrap,
#modal-estructura-manual .ms-ctx-wrap {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  flex-shrink: 0;   /* no se aplastan demasiado */
}

/* Botones de acciones */
#modal-estructura-manual .ms-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}

/* En móviles, que ocupen todo el ancho y se acomoden */
@media (max-width: 320px) {
  #modal-estructura-manual .ms-head {
    flex-direction: column;       /* pila todo */
    align-items: flex-start;      /* alineado a la izquierda */
  }

  #modal-estructura-manual .ms-actions {
    width: 100%;                  /* ocupa todo el ancho */
    justify-content: space-between;
  }
}

/* Popover del “Contexto” dentro de la tarjeta manual */
.ms-ctx-help-wrap { 
  position: relative; 
}

.ms-ctx-popover {
  position: absolute;
  top: 140%;            /* debajo del icono */
  left: 0;
  z-index: 1065;
  display: inline-block;
  width: auto;
  max-width: 200px;     /* más angosto */
  white-space: normal;  /* permite saltos de línea */
}

.ms-ctx-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  padding: .65rem .75rem;
  font-size: .85rem;
  line-height: 1.4;
  color: #374151;
  width: 160px;         /* fijo, más angosto */
  min-height: 60px;     /* asegura altura mínima */
  position: relative;
}

/* Flechita */
.ms-ctx-card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 14px;  
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  border-top: 1px solid #e5e7eb;
  transform: rotate(45deg);
}

/* Texto del cuerpo */
.ms-ctx-body {
  color: #374151;
  font-size: .85rem;
  line-height: 1.35;
  word-wrap: break-word;  /* ajusta palabras largas */
}

/* Icono info azul */
.ms-ctx-help-wrap i {
  color: #0d6efd;   /* azul bootstrap */
  cursor: pointer;
}

/* Botón/ícono info */
.hint-btn { line-height: 1; }
.hint-dot {
  display:inline-flex; align-items:center; justify-content:center;
  width:20px; height:20px; border-radius:50%;
  background:#e9f1ff; border:1px solid #1a73e8; 
  color:#1a73e8; font-size:12px;
}
.hint-dot i { font-size: 12px; line-height:1; }

#detallesInfoBatch {
  margin-bottom: 1rem; /* separa del dropzone */
}

.ctx-help-wrap a,
.ms-ctx-help-wrap a {
  background: transparent !important;
  outline: none !important;
  box-shadow: none !important;
}

/* Colores de fila según estado */
tr.state-MATCH         { background:#f6fffb; }   /* verde muy suave */
tr.state-PARTIAL       { background:#fffdf3; }   /* amarillo muy suave */
tr.state-ONLY_IN_USER  { background:#f7f9ff; }   /* azul muy suave */
tr.state-ONLY_IN_SYSTEM{ background:#f9f7ff; }   /* morado muy suave */

/* Leyenda */
.legend-item { border:1px solid rgba(0,0,0,.08); }
.legend-match{ background:#e7f8ef; color:#0f5132; }
.legend-partial{ background:#fff3cd; color:#664d03; }
.legend-only-user{ background:#e7f1ff; color:#084298; }
.legend-only-system{ background:#efe7ff; color:#3c2c63; }

/* Celdas con diferencia (para variante con values/diff) */
td.diff-cell .value-user { text-decoration: underline; }
td.diff-cell .vs { opacity:.6; margin: 0 .25rem; }

/* Chips de leyenda */
.chip{
  display:inline-flex; align-items:center; gap:.25rem;
  padding:.25rem .5rem; border-radius:.5rem;
  font-size:.8125rem; font-weight:600; border:1px solid transparent;
}
.chip-match{ background:#e6f4ea; color:#0b7a36; border-color:#b5e0c4; }
.chip-partial{ background:#fff4e5; color:#8a5a00; border-color:#ffd9a8; }
.chip-only-user{ background:#eef2ff; color:#1e40af; border-color:#c7d2fe; }
.chip-only-system{ background:#f1f5f9; color:#0f172a; border-color:#cbd5e1; }
.chip-invalid{ background:#fde7e9; color:#a31221; border-color:#f3b6bd; }

/* Item de lista por estado */
.cmp-item{ border-bottom:1px solid #edf2f7; padding:1rem; }
.cmp-item.match{ background:#f6fffa; }
.cmp-item.partial{ background:#fffaf0; }
.cmp-item.only-user, .cmp-item.only-system{ background:#f8fafc; }

/* Etiquetas secundarias visibles */
.badge.bg-secondary.text-dark{ color:#111 !important; background-color:#e9ecef !important; }

/* Scroll horizontal si el texto no cabe */
.menu-scroll-x{
  max-width: 100%;
  overflow-x: auto;       /* 👈 desplaza a la derecha/izq */
  overflow-y: auto;       /* lista larga = scroll vertical */
  max-height: 60vh;       /* opcional: alto máx del menú */
  white-space: nowrap;    /* no dividir el texto */
}

/* Cada opción en una línea y que no se corte */
.menu-scroll-x .dropdown-item{
  display: block;         /* sigue siendo lista vertical */
  white-space: nowrap;    /* que la línea no se quiebre */
  min-width: max-content; /* ancho real del contenido */
  padding-right: 1rem;    /* espacio para que no pegue al borde */
}

/* (Opcional) scrollbar más fino en WebKit */
.menu-scroll-x::-webkit-scrollbar{ height: 8px; }
.menu-scroll-x::-webkit-scrollbar-thumb{
  background: rgba(0,0,0,.15); border-radius: 6px;
}

#cmp-table-grid thead th.sticky-top { position: sticky; top: 0; background: #fff; z-index: 2; }
#cmp-table-grid td.cell-diff { background: rgba(255, 196, 0, .12); }
#cmp-table-grid tr.only-user { background: rgba(13, 110, 253, .08); }
#cmp-table-grid tr.only-system { background: rgba(108, 117, 125, .08); }
#cmp-table-grid td small.muted { color: #6c757d; }

/* chips de estado */
.chips-status .chip,
#cmp-legend .chip,
[data-cmp-status]{
  border-radius: 999px;
  padding: .35rem .8rem;
  background: #f1f3f5;
  color: #444;
  cursor: pointer;
  user-select: none;
  border: 1px solid #e9ecef;
}
[data-cmp-status].active{
  background: #111;
  color: #fff;
  border-color: #111;
}

.filter-pills{overflow:auto;white-space:nowrap;gap:8px;padding:4px;background:#fff;border-radius:8px;}
  .filter-pills .nav-link{background:#eef0f3;color:#6b7280;border-radius:9999px;margin-right:8px;}
  .filter-pills .nav-link.active{background:#111827;color:#fff;}

  /* Acordeón Detalles (container) */
.cmp-acc .accordion-item{
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;            /* fondo blanco */
  box-shadow: 0 1px 3px rgba(16,24,40,.04);
}

/* Header del acordeón */
.cmp-acc .accordion-button{
  background: #fff !important; /* blanco */
  color: #1f2937;
  font-weight: 600;
  padding: .6rem .9rem;        /* más compacto */
  box-shadow: none;
}
.cmp-acc .accordion-button:hover{
  background: #f8fafc !important; /* hover sutil */
}
.cmp-acc .accordion-button:not(.collapsed){
  border-bottom: 1px solid #e5e7eb;
}

/* Tabla de métricas compacta */
.cmp-stats-table thead th{
  background: #f7f9fc;
  color: #6b7280;
  font-weight: 600;
  border-bottom: 1px solid #e5e7eb;
}
.cmp-stats-table th,
.cmp-stats-table td{
  padding: .55rem .75rem;      /* compacto */
  border-color: #eef0f3;
}
.cmp-stats-table tbody tr:hover td{
  background: #f8fafc;
}

/* Duplicados: el contenedor del contenido colapsable */
#dup-user-row, #dup-system-row{
  border-top: 1px solid #eef0f3;
}

/* Icono info en azul */
#modal-add-field #af-ctx-help i {
  color: #0d6efd;
  cursor: pointer;
}

/* Tooltip 100% blanco con texto negro */
.tooltip .tooltip-inner{
  background:#fff !important;      /* fondo blanco */
  color:#111 !important;           /* texto negro */
  border:1px solid #e5e7eb !important;
  box-shadow:0 6px 18px rgba(0,0,0,.12);
  font-size:.9rem;
  border-radius:.5rem;
  padding:.6rem .75rem;
}

/* Flecha blanca según la posición */
.bs-tooltip-top    .tooltip-arrow::before{ border-top-color:#fff !important; }
.bs-tooltip-bottom .tooltip-arrow::before{ border-bottom-color:#fff !important; }
.bs-tooltip-start  .tooltip-arrow::before{ border-left-color:#fff !important; }
.bs-tooltip-end    .tooltip-arrow::before{ border-right-color:#fff !important; }

/* === Comparador: estilos de celdas === */
.cmp-cell-ok{ color:#198754; font-weight:600; }           /* success */
.cmp-cell-bad{ color:#dc3545; font-weight:600; }          /* danger  */
.cmp-cell-ghost{ font-size:.8em; color:#6c757d; text-decoration:line-through; }


/* PANEL LATERAL: tamaño, sombra, esquinas */
.sidebar-cuenta {
  /*width: 250px; */              /* → un poco más delgado */
  /*max-width: 88vw;*/
  border-radius: 0 20px 20px 0;
  box-shadow: 0 0 28px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

/* En móvil muy chico lo dejamos full width */
@media (max-width: 575.98px) {
  .sidebar-cuenta {
    width: 100%;
    border-radius: 0;
  }
}

/* HEADER OSCURO */
.sidebar-header {
  background: #252525;
  color: #fff;
  padding: 1.2rem 1.3rem;
}

.sidebar-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  background: #fff;
  border-radius: 999px;
}

.sidebar-account-name {
  font-size: 1.05rem;
  font-weight: 600;
}

.sidebar-account-subtitle {
  font-size: 0.85rem;
  color: #cacaca;
}

/* CUERPO */
.sidebar-body {
  padding: 1.2rem 1.3rem 0.8rem;
  font-size: 1.05rem;          /* → texto más grande */
}

/* TÍTULOS DE SECCIÓN */
.sidebar-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #777;
  margin-bottom: 0.6rem;
  letter-spacing: 0.05em;
}

/* LISTA DE OPCIONES */
.sidebar-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}

.sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.5rem;     /* → más alto */
  text-decoration: none;
  color: #222;
  border-radius: 12px;
  transition: background 0.15s ease, transform 0.05s ease;
}

.sidebar-item:hover {
  background: #f2f2f2;
}

.sidebar-item-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;                /* → más separación icono/texto */
}

/* ICONOS */
.sidebar-icon {
  font-size: 1.25rem;          /* → iconos más grandes */
  color: #555;
}

.sidebar-chevron {
  font-size: 1.05rem;          /* → chevron más grande */
  color: #aaa;
}

/* Cerrar sesión (sin rojo fuerte) */
.sidebar-item-logout .sidebar-icon {
  color: #444;
}

.sidebar-item-logout span {
  color: #444;
}

/* FOOTER */
.sidebar-footer {
  border-top: 1px solid #e8e8e8;
  padding: 0.9rem 1.3rem 1.2rem;
  font-size: 0.82rem;
  color: #888;
}

.sidebar-footer-icons {
  display: flex;
  justify-content: space-between; /* ← separa uniformemente */
  align-items: center;
  width: 100%;
  padding: 0 1rem; /* opcional, un poco de aire */
  margin-top: 0.5rem;
}

.sidebar-footer-icons i {
  font-size: 1.45rem;   /* un poquito más grande */
  color: #6f6f6f;
  opacity: 0.95;
}


#menuCuenta {
  --bs-offcanvas-width: 300px;
}

/* MODAL CRÉDITOS */
.modal-creditos-dialog {
  max-width: 1080px;
}

.modal-creditos {
  border-radius: 18px;
  overflow: hidden;
  border: none;
}

.modal-creditos-header {
  background: #ffffff !important;
  color: #222 !important;
  padding: 0.75rem 1.2rem !important;
  border-bottom: 1px solid #e8e8e8 !important;
  height: auto !important;
}

.modal-creditos-header .modal-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-creditos-body {
  padding: 1.2rem 1.5rem 1.3rem;
  background-color: #fafafa;
}

.modal-creditos-footer {
  background: #fff;
  border-top: 1px solid #eee;
  padding: 0.75rem 1.5rem;
  gap: 1rem;
}

/* Tarjetas resumen */
.card-resumen {
  border-radius: 14px;
  border: none;
}

.card-resumen .card-body {
  padding: 0.9rem 1rem;
}

.card-resumen .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #777;
}

.card-resumen h3 {
  font-size: 1.4rem;
  font-weight: 600;
}

/* Tabla historial */
#cred-tbody td {
  font-size: 0.9rem;
}

#cred-tbody tr:hover {
  background-color: #f5f5f5;
}

/* Barra de progreso */
#cred-progress-bar {
  background: linear-gradient(90deg, #2b6fe8, #4ba3ff);
}

/* Seguridad */

.logo-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.logo-center img {
  height: 65px; /* desktop */
}

/* Mobile */
@media (max-width: 500px) {
  .logo-center {
      position: static;   /* deja de estar centrado */
      transform: none;
  }

  .logo-center img {
      height: 45px;
  }
}

/*Seguridad*/

.security-hint {
  user-select: none;
}

.security-hint .hint-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #eef2ff; /* azul muy suave */
  color: #4f46e5; /* azul confianza */
  font-size: 0.9rem;
}

.security-info {
  background-color: #f9fafb;
  border: 1px dashed #e5e7eb;
}


.security-link {
  color: #2563eb;           /* azul link */
  font-weight: 500;
  text-decoration: none;
}

.security-link:hover {
  text-decoration: underline;
}

.security-link i {
  font-size: 1.1rem;
}

.ctx-preview{
  display: -webkit-box;
  -webkit-line-clamp: 2;      /* 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.2;
  max-width: 340px;           /* ajusta */
}

.ctx-more{
  text-decoration: none !important;
  line-height: 1;
}
.ctx-more i{
  font-size: 16px;
}

.ctx-wrap{
  display: flex;
  align-items: center;       /* <-- ESTE */
  justify-content: center;
  gap: 10px;
}


.ctx-link{
  cursor: pointer;
  text-decoration: none !important;
  text-align: center;
  line-height: 1.2;
  max-width: 260px; /* ajusta al ancho que quieras */
  display: block;
}

.ctx-short{
  display: -webkit-box;
  -webkit-line-clamp: 2;       /* 2 líneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
}

.ctx-full{
  white-space: normal;
}

.ctx-toggle{
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  line-height: 1;
}

.ctx-toggle i{
  display: inline-block;
  font-size: 18px;
}


.ctx-toggle.is-open i{
  transform: rotate(180deg); /* chevron-down se ve como up */
}

