/* ============================================================
   WispPRO — Tema "Donezo" (gris verdoso + verde pino + pills)
   ============================================================ */
:root {
  --bone:  #EFF2EF;   /* fondo general gris verdoso   */
  --card:  #FFFFFF;   /* superficies                  */
  --line:  #E4E9E4;   /* bordes sutiles               */
  --ink:   #1A1D1B;   /* texto principal              */
  --muted: #6E7A72;   /* texto secundario             */
  --teal:  #1D5D42;   /* verde pino (primario)        */
  --teal-2:#256E4E;
  --pino-osc: #143D2D;/* verde profundo (hero/cards)  */
  --green: #1D5D42;   /* acciones = verde pino        */
  --vivo:  #34B27B;   /* estados online / éxito       */
  --mint:  #E7F1EA;   /* fondos suaves verdes         */
  --menta: #7FC8A9;   /* acento menta decorativo      */
  --red:   #E5484D;
  --amber: #F5A524;
}

* { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
body { background: var(--bone); color: var(--ink); }

.num { font-variant-numeric: tabular-nums; }

/* Trama diagonal — firma visual Donezo */
.trama-diag {
  background-image: repeating-linear-gradient(
    45deg, rgba(29,93,66,.16) 0 3px, transparent 3px 9px);
}
.trama-diag-clara {
  background-image: repeating-linear-gradient(
    45deg, rgba(255,255,255,.14) 0 3px, transparent 3px 9px);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sb-link {
  display: flex; align-items: center; gap: .65rem;
  padding: .6rem .85rem; margin: 0 .75rem .15rem;
  border-radius: .8rem; font-size: .875rem; font-weight: 500;
  color: var(--muted); position: relative; transition: all .18s;
}
.sb-link:hover { background: var(--mint); color: var(--teal); }
.sb-link.activo {
  background: var(--teal); color: #fff; font-weight: 600;
  box-shadow: 0 6px 14px rgba(29,93,66,.28);
}
.sb-link.activo::before {          /* barra indicadora izquierda (estilo Donezo) */
  content: ''; position: absolute; left: -0.75rem; top: 18%;
  height: 64%; width: 4px; border-radius: 0 4px 4px 0; background: var(--teal);
}
.sb-link.activo .chip { background: rgba(255,255,255,.18); color: #fff; }
.sb-link.deshabilitado { opacity: .45; cursor: default; }
.sb-link.deshabilitado:hover { background: transparent; color: var(--muted); }
.sb-titulo {
  padding: 0 1.55rem; margin: 1.2rem 0 .45rem;
  font-size: .65rem; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: #9AA79E;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 1px 2px rgba(20,40,30,.03);
}
.card-hero {
  background: linear-gradient(135deg, var(--teal) 0%, var(--pino-osc) 100%);
  color: #fff; border-radius: 1.4rem;
  position: relative; overflow: hidden;
}
.card-hero::before {               /* trama diagonal decorativa en esquina */
  content: ''; position: absolute; right: -70px; top: -70px;
  width: 240px; height: 240px; border-radius: 9999px;
  background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.10) 0 4px, transparent 4px 11px);
  pointer-events: none;
}
.card-hero::after {
  content: ''; position: absolute; left: -50px; bottom: -80px;
  width: 190px; height: 190px; border-radius: 9999px;
  background: rgba(255,255,255,.05); pointer-events: none;
}

/* Punto de estado con pulso */
.dot { width: .55rem; height: .55rem; border-radius: 9999px; display: inline-block; }
.dot-online  { background: var(--vivo); box-shadow: 0 0 0 0 rgba(52,178,123,.5); animation: pulso 2s infinite; }
.dot-offline { background: var(--red); }
.dot-gris    { background: #C6CFC9; }
@keyframes pulso {
  0%   { box-shadow: 0 0 0 0 rgba(52,178,123,.45); }
  70%  { box-shadow: 0 0 0 7px rgba(52,178,123,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,178,123,0); }
}

/* ── Botones (pill, estilo Donezo) ────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .6rem 1.15rem; border-radius: 9999px;
  font-size: .845rem; font-weight: 600; transition: all .18s; cursor: pointer;
}
.btn-verde  { background: var(--teal); color: #fff; box-shadow: 0 6px 14px rgba(29,93,66,.25); }
.btn-verde:hover { background: var(--pino-osc); }
.btn-teal   { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--pino-osc); }
.btn-blanco { background: #fff; color: var(--ink); border: 1px solid #D8E0DA; }
.btn-blanco:hover { background: var(--mint); border-color: var(--menta); }
.btn-ghost-claro { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn-ghost-claro:hover { background: rgba(255,255,255,.22); }
.btn-mini { padding: .38rem .8rem; font-size: .78rem; }

/* ── Chips de estado ──────────────────────────────────────── */
.chip { padding: .2rem .65rem; border-radius: 9999px; font-size: .72rem; font-weight: 600; }
.chip-verde { background: var(--mint); color: #17603F; }
.chip-rojo  { background: #FDEBEC; color: #B42328; }
.chip-gris  { background: #EDF0ED; color: #566058; }
.chip-ambar { background: #FEF4E6; color: #B54708; }

/* ── Tablas ───────────────────────────────────────────────── */
.tabla th {
  text-align: left; font-size: .72rem; font-weight: 600; color: #9AA79E;
  text-transform: uppercase; letter-spacing: .05em;
  padding: .7rem 1rem; border-bottom: 1px solid var(--line);
}
.tabla td { padding: .85rem 1rem; font-size: .86rem; border-bottom: 1px solid #F0F3F0; }
.tabla tr:last-child td { border-bottom: none; }
.tabla tbody tr:hover td { background: #FAFCFA; }
.tabla th.der, .tabla td.der { text-align: right; }

/* ── Modal nativo ─────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(20,40,30,.5);
  display: none; align-items: center; justify-content: center;
  z-index: 50; padding: 1rem; backdrop-filter: blur(3px);
}
.modal-backdrop.abierto { display: flex; }
.modal-panel {
  background: var(--card); border-radius: 1.5rem; width: 100%; max-width: 520px;
  max-height: 92vh; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(20,40,30,.28);
  animation: modalIn .18s ease-out;
}
.modal-panel.ancho { max-width: 780px; }
.modal-panel.extra-ancho { max-width: 980px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

.form-label { display: block; font-size: .8rem; font-weight: 600; color: #3A443D; margin-bottom: .35rem; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: .6rem .9rem; font-size: .875rem;
  border: 1px solid #D3DCD5; border-radius: .85rem; background: #fff; color: var(--ink);
  transition: border .15s, box-shadow .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(29,93,66,.14);
}
.form-hint { font-size: .74rem; color: var(--muted); margin-top: .3rem; }

/* Bloque de código (script .rsc) */
.bloque-codigo {
  background: var(--pino-osc); color: #CBEEDC; border-radius: 1rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .74rem;
  padding: 1rem; overflow-x: auto; white-space: pre; line-height: 1.55; max-height: 320px; overflow-y: auto;
}

a:focus-visible, button:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 9999px; }

@media (prefers-reduced-motion: reduce) {
  .dot-online { animation: none; }
  .modal-panel { animation: none; }
}

/* ============================================================
   Sidebar flotante (card redondeada, estilo Donezo)
   ============================================================ */
.sb-panel {
  position: sticky; top: 1rem;
  margin: 1rem 0 1rem 1rem;
  height: calc(100vh - 2rem);
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 1.5rem;
  overflow-y: auto; overflow-x: hidden;
  box-shadow: 0 8px 24px rgba(20,40,30,.06);
}
.sb-panel::-webkit-scrollbar { width: 0; }

/* ── Menú flotante del avatar ─────────────────────────────── */
.menu-avatar { position: relative; }
.menu-flotante {
  position: absolute; right: 0; top: calc(100% + .55rem);
  min-width: 230px; background: var(--card);
  border: 1px solid var(--line); border-radius: 1.1rem;
  box-shadow: 0 18px 44px rgba(20,40,30,.18);
  padding: .45rem; display: none; z-index: 45;
}
.menu-flotante.abierto { display: block; animation: modalIn .15s ease-out; }
.menu-item {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .55rem .75rem; border-radius: .8rem;
  font-size: .84rem; font-weight: 500; color: var(--ink);
  cursor: pointer; transition: all .15s; text-align: left;
}
.menu-item:hover { background: var(--mint); color: var(--teal); }
.menu-item.peligro { color: #C13438; }
.menu-item.peligro:hover { background: #FDEBEC; color: #B42328; }
.menu-sep { height: 1px; background: var(--line); margin: .35rem .5rem; }

/* ============================================================
   MODO OSCURO — se activa con <html data-tema="dark">
   ============================================================ */
[data-tema="dark"] {
  --bone:  #0F1512;
  --card:  #19221D;
  --line:  #2A362F;
  --ink:   #E9EFEA;
  --muted: #97A69C;
  --teal:  #2E8A5F;
  --teal-2:#37996B;
  --pino-osc: #113022;
  --green: #2E8A5F;
  --vivo:  #3DC287;
  --mint:  #20342A;
  --menta: #6FBF9C;
}
[data-tema="dark"] body { background: var(--bone); color: var(--ink); }
[data-tema="dark"] .card { box-shadow: 0 1px 3px rgba(0,0,0,.3); }
[data-tema="dark"] .sb-panel { box-shadow: 0 8px 24px rgba(0,0,0,.3); }
[data-tema="dark"] .sb-link:hover { background: var(--mint); color: var(--menta); }
[data-tema="dark"] .sb-titulo { color: #6B7A70; }

[data-tema="dark"] .btn-blanco { background: var(--card); color: var(--ink); border-color: var(--line); }
[data-tema="dark"] .btn-blanco:hover { background: var(--mint); border-color: var(--teal); }

[data-tema="dark"] .form-input, [data-tema="dark"] .form-select, [data-tema="dark"] .form-textarea {
  background: #141C17; border-color: var(--line); color: var(--ink);
}
[data-tema="dark"] .form-input::placeholder, [data-tema="dark"] .form-textarea::placeholder { color: #5F6E64; }
[data-tema="dark"] .form-label { color: #B7C4BB; }
[data-tema="dark"] .form-hint { color: #7A897F; }

[data-tema="dark"] .tabla th { color: #7A897F; border-color: var(--line); }
[data-tema="dark"] .tabla td { border-color: #222C26; }
[data-tema="dark"] .tabla tbody tr:hover td { background: #1E2922; }

[data-tema="dark"] .chip-verde { background: #1E3A2C; color: #85DBB0; }
[data-tema="dark"] .chip-rojo  { background: #3B2325; color: #F1A0A4; }
[data-tema="dark"] .chip-gris  { background: #26302A; color: #AEBBB2; }
[data-tema="dark"] .chip-ambar { background: #3B301D; color: #F0C177; }

[data-tema="dark"] .modal-backdrop { background: rgba(0,0,0,.65); }
[data-tema="dark"] .bloque-codigo { background: #0C1811; color: #A9E5C6; }
[data-tema="dark"] .menu-item.peligro:hover { background: #3B2325; color: #F1A0A4; }
[data-tema="dark"] .dot-gris { background: #46554C; }
[data-tema="dark"] .trama-diag {
  background-image: repeating-linear-gradient(45deg, rgba(111,191,156,.25) 0 3px, transparent 3px 9px);
}

/* Iconos del toggle de tema */
[data-tema="dark"] .icono-sol  { display: inline-flex; }
[data-tema="dark"] .icono-luna { display: none; }
.icono-sol  { display: none; }
.icono-luna { display: inline-flex; }

/* ── Botones de icono (acciones de tabla) ─────────────────── */
.btn-icono {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: .65rem;
  background: var(--card); border: 1px solid #D8E0DA; color: var(--muted);
  cursor: pointer; transition: all .15s; vertical-align: middle;
}
.btn-icono:hover { background: var(--mint); border-color: var(--teal); color: var(--teal); }
.btn-icono.peligro { color: #C13438; }
.btn-icono.peligro:hover { background: #FDEBEC; border-color: #C13438; color: #B42328; }
.btn-icono.primario { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn-icono.primario:hover { background: var(--pino-osc); }
.btn-icono.exito { color: #17603F; }
.btn-icono.exito:hover { background: var(--mint); border-color: #17603F; }
[data-tema="dark"] .btn-icono { background: var(--card); border-color: var(--line); }
[data-tema="dark"] .btn-icono:hover { background: var(--mint); color: var(--menta); border-color: var(--teal); }
[data-tema="dark"] .btn-icono.peligro:hover { background: #3B2325; color: #F1A0A4; border-color: #F1A0A4; }


/* ── Tom-Select con la piel de WispPRO ────────────────────── */
.ts-wrapper { min-width: 0; }
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
  background: var(--card); border: 1px solid #D8E0DA; border-radius: .8rem;
  padding: .62rem .9rem; font-size: .86rem; color: var(--ink);
  box-shadow: none; min-height: 42px;
}
.ts-wrapper.focus .ts-control { border-color: var(--teal); box-shadow: 0 0 0 3px var(--mint); }
.ts-wrapper.single .ts-control:after { border-color: var(--muted) transparent transparent transparent; }
.ts-dropdown {
  background: var(--card); border: 1px solid var(--line); border-radius: .9rem;
  box-shadow: 0 16px 40px rgba(20,40,30,.14); font-size: .86rem; margin-top: 4px; overflow: hidden;
}
.ts-dropdown .option { padding: .55rem .9rem; color: var(--ink); }
.ts-dropdown .option.active { background: var(--mint); color: var(--teal); }
.ts-dropdown .ts-dropdown-input {
  background: var(--card); border: none; border-bottom: 1px solid var(--line);
  padding: .6rem .9rem; color: var(--ink); font-size: .86rem;
}
.ts-dropdown .no-results { padding: .6rem .9rem; color: var(--muted); }
.ts-control input { color: var(--ink) !important; font-size: .86rem; }
.ts-control input::placeholder { color: var(--muted); }
[data-tema="dark"] .ts-wrapper.single .ts-control,
[data-tema="dark"] .ts-wrapper.multi .ts-control { background: #141C17; border-color: var(--line); }
[data-tema="dark"] .ts-dropdown .ts-dropdown-input { background: #141C17; }

.btn-icono.grande { width: 38px; height: 38px; border-radius: .8rem; }


/* ── Soporte PRO: prioridad, visita y fotos ───────────────── */
.pill-prio {
  border: 1px solid var(--line); border-radius: .8rem; padding: .55rem .5rem;
  text-align: center; font-size: .82rem; font-weight: 600; transition: all .15s;
  color: var(--muted); background: var(--card);
}
input:checked + .pill-prio.prio-baja  { background: #E7F4EC; border-color: #17603F; color: #17603F; }
input:checked + .pill-prio.prio-media { background: #FDF3E7; border-color: #B54708; color: #B54708; }
input:checked + .pill-prio.prio-alta  { background: #FDEBEC; border-color: #B42328; color: #B42328; }
[data-tema="dark"] input:checked + .pill-prio.prio-baja  { background: #1E3A2C; color: #85DBB0; }
[data-tema="dark"] input:checked + .pill-prio.prio-media { background: #3B301D; color: #F0C177; }
[data-tema="dark"] input:checked + .pill-prio.prio-alta  { background: #3B2325; color: #F1A0A4; }

/* Barra lateral de prioridad en la tabla de tickets */
.fila-prio-alta  td:first-child { box-shadow: inset 3px 0 0 #B42328; }
.fila-prio-media td:first-child { box-shadow: inset 3px 0 0 #E8A33D; }
.fila-prio-baja  td:first-child { box-shadow: inset 3px 0 0 #34B27B; }

/* Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-pista {
  position: absolute; inset: 0; border-radius: 999px; background: #D8E0DA;
  transition: .2s; cursor: pointer;
}
.switch-pista:before {
  content: ''; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + .switch-pista { background: var(--teal); }
.switch input:checked + .switch-pista:before { transform: translateX(18px); }
[data-tema="dark"] .switch-pista { background: #3A473F; }

/* Previews de fotos al crear */
.foto-prev { position: relative; aspect-ratio: 1; border-radius: .7rem; overflow: hidden; border: 1px solid var(--line); }
.foto-prev img { width: 100%; height: 100%; object-fit: cover; }
.foto-x {
  position: absolute; top: 4px; right: 4px; width: 20px; height: 20px;
  background: rgba(0,0,0,.65); color: #fff; border-radius: 50%;
  font-size: 11px; line-height: 1; display: grid; place-items: center;
}
.foto-peso {
  position: absolute; bottom: 0; left: 0; right: 0; font-size: 9px; text-align: center;
  background: rgba(0,0,0,.55); color: #fff; padding: 2px 0;
}

/* Galería en el detalle */
.foto-thumb { width: 76px; height: 76px; border-radius: .7rem; overflow: hidden; border: 1px solid var(--line); display: block; }
.foto-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.foto-thumb:hover img { transform: scale(1.06); }


/* ── Chat del ticket ──────────────────────────────────────── */
.chip-morado { background: #F0EBFA; color: #6941C6; }
[data-tema="dark"] .chip-morado { background: #2E2444; color: #C4B0F3; }
[data-tema="dark"] #dt_qc { background: #241C36 !important; }

.chat-caja { max-height: 300px; overflow-y: auto; padding: .5rem; background: var(--bone); border-radius: .9rem; }
.chat-msg { display: flex; margin-bottom: .5rem; }
.chat-msg.der { justify-content: flex-end; }
.chat-msg.izq { justify-content: flex-start; }
.chat-burbuja {
  max-width: 78%; padding: .5rem .75rem; border-radius: 1rem; font-size: .82rem; line-height: 1.45;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
}
.chat-msg.der .chat-burbuja { background: var(--teal); border-color: var(--teal); color: #fff; border-bottom-right-radius: .3rem; }
.chat-msg.izq .chat-burbuja { border-bottom-left-radius: .3rem; }
.chat-meta { display: block; font-size: .64rem; opacity: .65; margin-top: .25rem; }
.chat-sistema { text-align: center; margin: .6rem 0; }
.chat-sistema span {
  font-size: .7rem; color: var(--muted); background: var(--card);
  border: 1px solid var(--line); border-radius: 999px; padding: .2rem .7rem;
}
.chat-foto { max-width: 180px; border-radius: .6rem; display: block; margin-bottom: .3rem; }

.chat-caja.chat-alta { max-height: 380px; min-height: 260px; }

/* ── Scroll elegante DENTRO de los modales y paneles ────────
   Fino, redondeado, sin flechas, y con margen para no tocar
   las esquinas redondeadas del panel. */
.modal-panel, .chat-caja, .bloque-codigo, .menu-flotante, .sb-panel, .ts-dropdown .ts-dropdown-content {
  scrollbar-width: thin;                          /* Firefox */
  scrollbar-color: #C3CFC7 transparent;
}
.modal-panel::-webkit-scrollbar,
.chat-caja::-webkit-scrollbar,
.bloque-codigo::-webkit-scrollbar,
.ts-dropdown .ts-dropdown-content::-webkit-scrollbar { width: 8px; }
.modal-panel::-webkit-scrollbar-track { background: transparent; margin: 22px 0; }
.chat-caja::-webkit-scrollbar-track,
.bloque-codigo::-webkit-scrollbar-track { background: transparent; margin: 10px 0; }
.modal-panel::-webkit-scrollbar-thumb,
.chat-caja::-webkit-scrollbar-thumb,
.bloque-codigo::-webkit-scrollbar-thumb,
.ts-dropdown .ts-dropdown-content::-webkit-scrollbar-thumb {
  background: #C3CFC7; border-radius: 999px;
  border: 2px solid transparent; background-clip: padding-box;
}
.modal-panel::-webkit-scrollbar-thumb:hover { background: #9FB0A5; background-clip: padding-box; border: 2px solid transparent; border-radius: 999px; }
.modal-panel::-webkit-scrollbar-button { display: none; height: 0; }   /* sin flechas */
[data-tema="dark"] .modal-panel, [data-tema="dark"] .chat-caja, [data-tema="dark"] .bloque-codigo {
  scrollbar-color: #3A473F transparent;
}
[data-tema="dark"] .modal-panel::-webkit-scrollbar-thumb,
[data-tema="dark"] .chat-caja::-webkit-scrollbar-thumb,
[data-tema="dark"] .bloque-codigo::-webkit-scrollbar-thumb {
  background: #3A473F; border: 2px solid transparent; background-clip: padding-box;
}

/* El backdrop nunca scrollea: el scroll vive dentro del panel */
.modal-backdrop { overflow: hidden; }

/* ── Toasts propios (reemplazan a SweetAlert) ── */
#wsp-toasts {
  position: fixed; top: 18px; right: 18px; z-index: 9999;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.wsp-toast {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fff; border: 1px solid var(--linea, #E4E9E4);
  border-left: 4px solid var(--teal, #1D5D42);
  border-radius: 12px; padding: 12px 16px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .10);
  font-size: 13.5px; font-weight: 500; color: var(--ink, #1A1D1B);
  max-width: 380px; line-height: 1.45;
  opacity: 0; transform: translateX(16px);
  transition: opacity .22s ease, transform .22s ease;
  pointer-events: auto;
}
.wsp-toast.visible { opacity: 1; transform: translateX(0); }
.wsp-toast.err { border-left-color: #B42328; }
.wsp-toast .ico { font-size: 15px; line-height: 1.35; }

/* Botón de acción destructiva (diálogos y modales) */
.btn-peligro {
  background: #B42328; color: #fff; border: 0;
}
.btn-peligro:hover { background: #9C1D22; }

/* ── Selects buscables (Tom-Select): una sola línea, sin crecer ── */
.ts-wrapper.single .ts-control,
.ts-wrapper.multi .ts-control {
  min-height: 40px;
  padding: .55rem .8rem !important;
  white-space: nowrap;
  overflow: hidden;
}
.ts-control > .item {
  display: inline-block;
  max-width: calc(100% - 14px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

/* ── Menú de acciones (…) en las tablas ── */
.acciones-menu { position: relative; display: inline-block; }
.acciones-lista {
  /* Fijo respecto a la ventana: así el menú NO lo recorta el contenedor
     de la tabla y esta puede quedarse dentro del card (antes había que
     poner overflow-visible y la tabla se desbordaba). JS calcula top/left. */
  position: fixed; z-index: 1200;
  background: var(--card, #fff); border: 1px solid var(--linea, #E4E9E4);
  border-radius: .85rem; box-shadow: 0 10px 30px rgba(0,0,0,.12);
  min-width: 190px; padding: .35rem; text-align: left;
}
.acciones-lista button,
.acciones-lista a {
  display: flex; align-items: center; gap: .6rem; width: 100%;
  padding: .5rem .7rem; border-radius: .6rem; font-size: .8rem; font-weight: 600;
  color: var(--ink, #1A1D1B); background: none; border: 0; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.acciones-lista button:hover,
.acciones-lista a:hover { background: var(--bone, #EFF2EF); }
.acciones-lista .peligro { color: #B42328; }
.acciones-lista .sep { height: 1px; background: var(--linea, #E4E9E4); margin: .3rem 0; }

/* ── Tabla compacta: filas más bajas (listas largas) ── */
.tabla.compacta th { padding: .55rem .75rem; }
.tabla.compacta td { padding: .6rem .75rem; font-size: .84rem; }
.tabla.compacta td p { line-height: 1.35; }

/* ═══════════════ Indicador de espera global ═══════════════
   Lo muestra postForm en cualquier acción (suspender, reactivar,
   guardar, cobrar…). Aparece a los 250 ms para no parpadear. */
#wsp-espera {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 24, 20, .28);
  backdrop-filter: blur(2.5px);
  -webkit-backdrop-filter: blur(2.5px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease, visibility .18s ease;
}
#wsp-espera.visible { opacity: 1; visibility: visible; }

.wsp-espera-caja {
  background: #fff;
  border-radius: 18px;
  padding: 26px 34px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
  text-align: center;
  min-width: 240px;
  transform: translateY(8px) scale(.97);
  transition: transform .22s cubic-bezier(.2, .8, .3, 1);
}
#wsp-espera.visible .wsp-espera-caja { transform: translateY(0) scale(1); }

.wsp-espera-anillo {
  width: 42px;
  height: 42px;
  margin: 0 auto 14px;
  border: 3.5px solid var(--mint, #E4F2EA);
  border-top-color: var(--teal, #1D5D42);
  border-radius: 50%;
  animation: wsp-girar .75s linear infinite;
}
@keyframes wsp-girar { to { transform: rotate(360deg); } }

.wsp-espera-txt {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink, #10261D);
  margin: 0;
}
.wsp-espera-sub {
  font-size: 12px;
  color: var(--muted, #6B7B72);
  margin: 4px 0 0;
}

/* Modo oscuro (el tema se marca con data-tema="dark" en la raíz) */
[data-tema="dark"] .wsp-espera-caja { background: #14201B; }
[data-tema="dark"] .wsp-espera-txt  { color: #E8F0EB; }
[data-tema="dark"] #wsp-espera      { background: rgba(0, 0, 0, .45); }

@media (prefers-reduced-motion: reduce) {
  .wsp-espera-anillo { animation-duration: 1.6s; }
  .wsp-espera-caja   { transition: none; }
}

/* ── Pestañas de Configuración ── */
.tabs-config {
  display: flex; flex-wrap: wrap; gap: .4rem;
  border-bottom: 1px solid var(--linea, #E4E9E4); padding-bottom: .55rem;
}
.tab-cfg {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem; border-radius: .7rem;
  font-size: .82rem; font-weight: 700; text-decoration: none;
  color: var(--muted, #6E7A72); background: transparent;
  border: 1px solid transparent; transition: .15s;
}
.tab-cfg:hover { background: var(--bone, #EFF2EF); color: var(--ink, #1A1D1B); }
.tab-cfg.activa {
  background: var(--mint, #E7F1EA); color: var(--teal, #1D5D42);
  border-color: rgba(29, 93, 66, .22);
}
