/* ====== webs.pro — Panel oscuro profesional ====== */
:root {
  --bg: #0c0f14;
  --surface: #141922;
  --surface-2: #1b212c;
  --surface-3: #222a37;
  --border: #283040;
  --text: #e6ebf2;
  --muted: #8a94a6;
  --accent: #4f8cff;
  --accent-2: #6ea0ff;
  --accent-soft: rgba(79, 140, 255, 0.14);
  --logo-blue: #0081ff;
  --ok: #34d399;
  --warn: #f59e0b;
  --err: #f87171;
  --proc: #38bdf8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --sidebar-w: 248px;
  --sidebar-collapsed-w: 68px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

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

a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(79, 140, 255, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(110, 160, 255, 0.08), transparent 60%),
    var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 36px 32px;
}

.login-card .brand { justify-content: center; margin-bottom: 6px; }
.login-card .sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 26px;
  font-size: 13px;
}

/* ---------- Marca ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
}
.brand .dot {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--accent), #8a6bff);
  display: grid; place-items: center;
  color: white; font-size: 15px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(79, 140, 255, 0.4);
}
.brand-logo {
  width: 32px; height: 32px; display: block; flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 129, 255, 0.4); border-radius: 50%;
}
.brand b { color: var(--text); }
.brand span { color: var(--logo-blue); }

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.18s ease;
}
.sidebar-top { padding: 22px 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sidebar-collapse {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0;
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--muted); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sidebar-collapse:hover { background: var(--surface-2); color: var(--text); }
.sidebar-collapse svg { width: 17px; height: 17px; }
.nav { padding: 12px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  cursor: pointer;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 0.15s, color 0.15s;
  user-select: none;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--accent-soft);
  color: var(--accent-2);
  border-color: rgba(79, 140, 255, 0.25);
}
.nav-item svg { width: 19px; height: 19px; flex-shrink: 0; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }

/* ---------- Sidebar colapsado (riel de íconos) ---------- */
.sidebar.collapsed {
  width: var(--sidebar-collapsed-w);
  min-width: var(--sidebar-collapsed-w);      /* si no, el min-content del contenido lo mantiene ancho */
  flex-basis: var(--sidebar-collapsed-w);
}
.sidebar.collapsed .sidebar-top { flex-direction: column; gap: 14px; padding: 20px 10px 10px; }
.sidebar.collapsed .brand span { display: none; }        /* oculta el texto "webs.pro" */
.sidebar.collapsed .brand { justify-content: center; }
.sidebar.collapsed .nav { padding: 12px 10px; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 11px 0; gap: 0; }
.sidebar.collapsed .nav-label { display: none; }         /* oculta los nombres de sección */
.sidebar.collapsed .sidebar-foot .btn { justify-content: center; padding-left: 0; padding-right: 0; }

.main { flex: 1; min-width: 0; padding: 26px 30px 60px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.topbar h1 { font-size: 22px; margin: 0; letter-spacing: -0.02em; }
.topbar .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Secciones ---------- */
.seccion { display: none; animation: fade 0.2s ease; }
.seccion.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
  font-family: inherit;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: #fff;
}
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-danger { color: var(--err); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.4); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; justify-content: center; }

/* ---------- Inputs ---------- */
input[type="text"], input[type="password"], input[type="url"], textarea, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 120px; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
select.mini { padding: 6px 8px; font-size: 12.5px; width: auto; min-width: 150px; }

/* ---------- Cards / paneles ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
}
.card + .card { margin-top: 18px; }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat .n { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.stat .l { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat.accent .n { color: var(--accent-2); }
.stat.ok .n { color: var(--ok); }
.stat.err .n { color: var(--err); }

/* ---------- Tabla ---------- */
.tabla-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table.tabla { width: 100%; border-collapse: collapse; min-width: 760px; }
table.tabla th, table.tabla td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tabla thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  position: sticky; top: 0;
}
table.tabla tbody tr { background: var(--surface); }
table.tabla tbody tr:hover { background: var(--surface-2); }
.url-cell { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.url-cell a { color: var(--text); }
.fecha { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.acciones { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Badges de estado ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.Pendiente { color: var(--muted); background: var(--surface-3); }
.badge.Procesando { color: var(--proc); background: rgba(56, 189, 248, 0.12); }
.badge.Listo { color: var(--ok); background: rgba(52, 211, 153, 0.12); }
.badge.Error { color: var(--err); background: rgba(248, 113, 113, 0.12); }

.pill { font-size: 12px; color: var(--muted); background: var(--surface-3); padding: 3px 9px; border-radius: 999px; }
.pill.has { color: var(--accent-2); background: var(--accent-soft); }

/* ---------- Grids de imágenes / plantillas ---------- */
.grid { display: grid; gap: 16px; }
.grid.plantillas { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid.imgs { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }

.tarjeta-plantilla {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
}
.tarjeta-plantilla .preview {
  position: relative; height: 170px; background: #fff; overflow: hidden; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.tarjeta-plantilla .preview iframe {
  width: 1280px; height: 980px; border: 0;
  transform: scale(0.235); transform-origin: top left; pointer-events: none;
}
.tarjeta-plantilla .preview .ver {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(12, 15, 20, 0.0); transition: background 0.15s; opacity: 0;
}
.tarjeta-plantilla .preview:hover .ver { background: rgba(12, 15, 20, 0.55); opacity: 1; }
.tarjeta-plantilla .info { padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tarjeta-plantilla .info .nombre { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.tarjeta-plantilla .tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px 0; }
.tarjeta-plantilla .tab-pg {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--muted);
  cursor: pointer; font-family: inherit; text-transform: capitalize; line-height: 1.6;
}
.tarjeta-plantilla .tab-pg:hover { color: var(--text); background: var(--surface-3); }
.tarjeta-plantilla .tab-pg.active { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(79, 140, 255, 0.3); }

.tarjeta-img {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1 / 1;
}
.tarjeta-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tarjeta-img .x {
  position: absolute; top: 6px; right: 6px;
  width: 26px; height: 26px; border-radius: 7px; border: none;
  background: rgba(12, 15, 20, 0.7); color: #fff; cursor: pointer;
  display: grid; place-items: center;
  opacity: 0; transition: opacity 0.15s;
}
.tarjeta-img:hover .x { opacity: 1; }
.tarjeta-img .check {
  position: absolute; top: 6px; left: 6px;
  width: 22px; height: 22px; cursor: pointer; accent-color: var(--accent);
}

/* ---------- Banco: categorías ---------- */
.cat-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 12px; gap: 10px; }
.cat-head h3 { margin: 0; font-size: 16px; text-transform: capitalize; }
.cat-head .count { color: var(--muted); font-size: 13px; }

/* ---------- Estado vacío ---------- */
.vacio { text-align: center; color: var(--muted); padding: 48px 20px; }
.vacio svg { width: 42px; height: 42px; opacity: 0.5; margin-bottom: 10px; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(5, 7, 11, 0.7);
  backdrop-filter: blur(3px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-bg.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow);
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal.lg { max-width: 1100px; }
.modal-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16.5px; }
/* El cuerpo scrollea; la barra inferior queda fija abajo (min-height:0 para que el flex permita el scroll). */
.modal-body { padding: 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { flex-shrink: 0; padding: 16px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.modal .frame-full { width: 100%; height: 78vh; border: 0; background: #fff; border-radius: 0 0 14px 14px; }
.icon-btn { background: transparent; border: none; color: var(--muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }

/* ---------- Dropzone / subida ---------- */
.dropzone {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 26px; text-align: center; color: var(--muted); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 22px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 200; }
.toast {
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm); padding: 12px 16px; min-width: 240px; max-width: 360px;
  box-shadow: var(--shadow); animation: slidein 0.2s ease;
  font-size: 13.5px;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--err); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

.alert { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.35); color: #fecaca; padding: 11px 14px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 8px; }
.spinner { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hamburguesa (mobile) ---------- */
.hamb { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; z-index: 90; left: 0; top: 0; transform: translateX(-100%);
    transition: transform 0.2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .main { padding: 18px 16px 50px; }
  .hamb { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 85; display: none; }
  .scrim.open { display: block; }
  /* En mobile el sidebar es un drawer: el colapso no aplica (lo maneja la hamburguesa). */
  .sidebar-collapse { display: none; }
  .sidebar.collapsed { width: var(--sidebar-w); }
  .sidebar.collapsed .brand span,
  .sidebar.collapsed .nav-label { display: inline; }
  .sidebar.collapsed .sidebar-top { flex-direction: row; padding: 22px 20px 10px; }
  .sidebar.collapsed .nav-item { justify-content: flex-start; padding: 11px 14px; gap: 12px; }
}

/* ====== Banco: hover con metadata, formatos, drag&drop, selección ====== */
/* Overlay con medidas + peso al pasar el mouse */
.tarjeta-img .meta-ov {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: rgba(8, 11, 16, 0); color: #fff; font-size: 12px; font-weight: 600;
  opacity: 0; transition: opacity 0.18s ease, background 0.18s ease; pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.tarjeta-img:hover .meta-ov { opacity: 1; background: rgba(8, 11, 16, 0.55); }
.tarjeta-img .x, .tarjeta-img .check { z-index: 3; }

/* Badge de formato (verde / amarillo / rojo) */
.tarjeta-img .fmt {
  position: absolute; left: 6px; bottom: 6px; z-index: 2;
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; letter-spacing: 0.02em;
}
.fmt-ok   { background: rgba(52, 211, 153, 0.22); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.4); }
.fmt-warn { background: rgba(245, 158, 11, 0.20); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.4); }
.fmt-bad  { background: rgba(248, 113, 113, 0.20); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.4); }
.fmt-na   { background: var(--surface-3); color: var(--muted); }

/* Drag & drop entre categorías */
.banco-cat { margin-bottom: 10px; }
.tarjeta-img[draggable="true"] { cursor: grab; }
.tarjeta-img.dragging { opacity: 0.4; }
.cat-drop { border-radius: var(--radius-sm); transition: background 0.15s, outline 0.15s; min-height: 40px; }
.cat-drop.drag-over { outline: 2px dashed var(--accent); outline-offset: 3px; background: var(--accent-soft); }

/* Selección con checkbox en el modal */
.tarjeta-img.sel-img { cursor: pointer; }
.tarjeta-img.sel-img .check {
  position: absolute; top: 6px; left: 6px; width: 20px; height: 20px; accent-color: var(--accent);
}
.tarjeta-img.sel { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Tabs del banco dentro del modal (reusa .tab-pg) y sub-títulos */
.banco-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.modal-sub { margin: 18px 0 8px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Guía de formatos */
.guia-formatos { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; font-size: 12.5px; }
.guia-formatos ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 5px 16px; }
.guia-formatos li { color: var(--muted); display: flex; align-items: center; gap: 8px; }
.guia-formatos .dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.guia-formatos .dot.v { background: #6ee7b7; }
.guia-formatos .dot.p { background: #fbbf24; }
.guia-formatos .dot.h { background: #7dd3fc; }
.guia-formatos .dot.c { background: #c4b5fd; }

/* ---------- Slots visuales de la plantilla (modal de imágenes) ---------- */
.slots-zona { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 4px; }
.slot {
  height: 120px; aspect-ratio: 1; flex: 0 0 auto;
  background: var(--surface-2); border: 2px dashed var(--border); border-radius: 8px;
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.slot.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.slot.filled { border-style: solid; }
.slot.filled.ok { border-color: #34d399; }
.slot.filled.warn { border-color: #fbbf24; }
.slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot .slot-empty { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); text-align: center; padding: 6px; pointer-events: none; }
.slot-tag { font-size: 10px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }
.slot-dim { font-size: 10px; opacity: 0.75; }
.slot .slot-x {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px;
  border: none; border-radius: 6px; background: rgba(8, 11, 16, 0.7); color: #fff;
  cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity 0.15s; z-index: 3;
}
.slot:hover .slot-x { opacity: 1; }
.slot-aviso {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  background: rgba(245, 158, 11, 0.92); color: #1a1206;
  font-size: 9.5px; line-height: 1.2; text-align: center; padding: 2px 4px;
}
/* Slot de logo / logotipo: visualmente diferenciado (dorado, punteado). */
.slot-logo { border-color: #fbbf24; background: rgba(245, 158, 11, 0.07); }
.slot-logo .slot-tag { color: #fbbf24; }
.slot-logo.filled { border-color: #fbbf24; }
/* Imagen que ya trae la plantilla (default, reemplazable arrastrando otra). */
.slot.slot-default { border-style: dashed; opacity: 0.85; }
.slot.slot-default img { filter: saturate(0.85); }
.slot-aviso-info { background: rgba(56, 189, 248, 0.9); color: #06283b; }

/* Botón de categoría del banco como zona de drop (mover / sumar al banco). */
.tab-pg.drop-cat { outline: 2px dashed var(--accent); outline-offset: 2px; background: var(--accent-soft); color: var(--accent-2); }

/* Botón "PNG" (sacar fondo) en tarjetas de origen y en slots. */
.card-png, .slot-png {
  position: absolute; border: none; cursor: pointer; z-index: 4;
  font-family: inherit; font-size: 9.5px; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(8, 11, 16, 0.72); color: #fff;
  opacity: 0; transition: opacity 0.15s, background 0.15s;
}
.card-png { bottom: 6px; left: 6px; }
.slot-png { bottom: 4px; left: 4px; }
.tarjeta-img:hover .card-png, .slot:hover .slot-png { opacity: 1; }
.card-png:hover, .slot-png:hover { background: var(--accent); }
.card-png:disabled, .slot-png:disabled { opacity: 0.5; cursor: default; }

/* Damero para que se vea la transparencia de los PNG sin fondo. */
.slot.filled, .tarjeta-img.fuente {
  background-image:
    linear-gradient(45deg, #2b3340 25%, transparent 25%),
    linear-gradient(-45deg, #2b3340 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2b3340 75%),
    linear-gradient(-45deg, transparent 75%, #2b3340 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

.aviso-antibot { color: #fbbf24; font-weight: 600; }

/* ====== Modal de imágenes: preview de la plantilla (izq) + fuentes (der) ====== */
.img2-body { display: flex; padding: 0; height: 74vh; overflow: hidden; }
.prev-pane { flex: 3; display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--border); }
.prev-nav { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.prev-pg { font-size: 12px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; white-space: nowrap; font-family: inherit; text-transform: capitalize; }
.prev-pg.active { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(79, 140, 255, 0.4); }
.prev-arrow { background: transparent; border: none; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.prev-arrow:hover { color: var(--text); }
.prev-tools { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.prev-tool { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); font-family: inherit; font-size: 11px; padding: 3px 9px; border-radius: 6px; cursor: pointer; }
.prev-tool:hover { color: var(--text); background: var(--surface-3); }
.prev-pick { color: var(--accent-2); font-size: 11.5px; }
.prev-tool-hint { margin-left: auto; color: var(--muted); font-size: 10.5px; }
.prev-zoom { display: inline-flex; align-items: center; gap: 4px; margin-left: 10px; }
#zoom-lbl { font-size: 11px; color: var(--muted); min-width: 36px; text-align: center; }
.prev-stage { flex: 1; position: relative; background: #fff; overflow: auto; }
.prev-scaler { position: relative; }
.prev-stage iframe { position: absolute; top: 0; left: 0; border: 0; background: #fff; display: block; }
.prev-cargando { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: var(--surface); font-size: 13px; }
.src-pane { flex: 1; min-width: 232px; max-width: 320px; display: flex; flex-direction: column; min-height: 0; }
.src-tabs { display: flex; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.src-tab { flex: 1; padding: 9px 4px; background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted); font-family: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.src-tab:hover { color: var(--text); }
.src-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }
.src-head { padding: 8px 10px 6px; font-size: 12px; color: var(--muted); flex-shrink: 0; }
.src-cont { flex: 1; overflow-y: auto; padding: 0 10px 10px; min-height: 0; }
.src-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.src-foot { padding: 7px 10px; border-top: 1px solid var(--border); font-size: 10.5px; color: var(--muted); flex-shrink: 0; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.cat-chip { font-size: 11px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; font-family: inherit; }
.cat-chip.active { background: var(--accent-soft); color: var(--accent-2); border-color: rgba(79, 140, 255, 0.4); }
.cat-chip.drop-cat { outline: 2px dashed var(--accent); outline-offset: 2px; }
.src-cont .fuente {
  position: relative; aspect-ratio: 1; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 8px; overflow: hidden; cursor: grab;
  background-image:
    linear-gradient(45deg, #2b3340 25%, transparent 25%), linear-gradient(-45deg, #2b3340 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2b3340 75%), linear-gradient(-45deg, transparent 75%, #2b3340 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.src-cont .fuente img { width: 100%; height: 100%; object-fit: cover; display: block; }
.src-cont .fuente.armado { outline: 2px solid var(--accent); outline-offset: 1px; }
.src-cont .fuente.dragging { opacity: 0.4; }
.src-cont .card-png { position: absolute; left: 4px; bottom: 4px; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; border: none; background: rgba(8, 11, 16, 0.72); color: #fff; cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.src-cont .fuente:hover .card-png { opacity: 1; }
.src-cont .card-png:hover { background: var(--accent); }

/* ====== Estado "Descargada" ====== */
.badge.Descargada { color: var(--muted); background: var(--surface-3); }

/* ====== Tabs de la cola (Pendientes / Procesadas / Descargadas) ====== */
.cola-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.cola-tab, .leads-tab {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  color: var(--muted); font-family: inherit; font-size: 13.5px; font-weight: 600;
  padding: 10px 14px; cursor: pointer; letter-spacing: 0.01em;
  transition: color 0.15s, border-color 0.15s;
}
.cola-tab:hover, .leads-tab:hover { color: var(--text); }
.cola-tab.active, .leads-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }
.cola-tab .tab-count, .leads-tab .tab-count {
  font-size: 11.5px; font-weight: 700; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted);
}
.cola-tab.active .tab-count, .leads-tab.active .tab-count { background: var(--accent-soft); color: var(--accent-2); }

.cola-pane[hidden] { display: none; }
.pane-actions { display: flex; justify-content: flex-end; margin-bottom: 12px; }
.cola-pane[data-pane="descargadas"] table.tabla { min-width: 620px; }

/* ====== Ranking de leads (vista de tabla) ====== */
.leads-pane[hidden] { display: none; }

/* Banner con el paso a paso para la captura manual */
.captura-ayuda {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 14px;
  font-size: 12.5px; color: var(--muted); line-height: 1.7;
}
.captura-ayuda strong { color: var(--text); }
.captura-ayuda .pasos { white-space: nowrap; }
.captura-ayuda kbd {
  font-family: ui-monospace, monospace; font-size: 11px;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: 5px; padding: 1px 6px; color: var(--text);
}

/* Contenedor con scroll fijo en pantalla: alto acotado -> la barra horizontal
   queda siempre visible (no al final de una lista larga) y el header se fija. */
.leads-scroll { max-height: calc(100vh - 300px); overflow: auto; }
.leads-tabla thead th { position: sticky; top: 0; z-index: 3; }

.leads-tabla { min-width: 980px; }
.leads-tabla td { vertical-align: middle; }
.leads-tabla .col-thumb, .leads-tabla .col-chk,
.leads-tabla .col-estado, .leads-tabla .col-contacto { width: 1%; white-space: nowrap; }
.leads-tabla .col-acc { width: 1%; white-space: nowrap; }
.leads-tabla .col-chk { text-align: center; }
.leads-tabla .lead-check, .leads-tabla .lead-check-all { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* Botones solo-ícono de la columna de acciones */
.btn.btn-ico {
  padding: 5px 8px; line-height: 1; font-size: 13px; min-width: 30px;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn.btn-ico svg { display: block; }

/* Barra de acciones para la selección múltiple */
.leads-bulk { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.leads-bulk[hidden] { display: none; }
.leads-bulk .bulk-lbl { font-size: 12.5px; color: var(--muted); }

/* Buscador de la tab Seleccionados */
.leads-search { margin-bottom: 12px; }
.leads-search input {
  width: 100%; max-width: 460px; padding: 9px 12px; font-size: 13.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-family: inherit;
}
.leads-search input:focus { outline: none; border-color: var(--accent); }

/* Sub-estado de contacto en la tab Seleccionados */
.estado-sel { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ct-badge { font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.ct-badge.ct-none { background: var(--surface-3); color: var(--muted); }
.ct-badge.ct-cont { background: rgba(56, 189, 248, 0.14); color: var(--proc); }
.ct-badge.ct-resp { background: rgba(52, 211, 153, 0.16); color: var(--ok); }

/* Botón "Respondió" y fila diferenciada de un lead que ya respondió */
.btn.btn-respondio { background: rgba(52, 211, 153, 0.14); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.4); }
.btn.btn-respondio:hover { background: rgba(52, 211, 153, 0.24); }
.leads-tabla tr.lead-resp { background: rgba(52, 211, 153, 0.07); }
.leads-tabla tr.lead-resp td:first-child { box-shadow: inset 3px 0 0 var(--ok); }

.lead-thumb-sm {
  display: inline-flex; align-items: center; justify-content: center;
  width: 84px; height: 52px; border-radius: 7px; overflow: hidden;
  background: #0b0e13; color: var(--muted); font-size: 15px; text-decoration: none;
  border: 1px solid var(--border);
}
.lead-thumb-sm img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.lead-thumb-sm.error { color: var(--err); }
.lead-thumb-sm.cargando { color: var(--proc); }

.lead-nombre { font-weight: 600; display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.lead-url { color: var(--accent-2); text-decoration: none; display: inline-block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.lead-url:hover { text-decoration: underline; }
.lead-dir { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; color: var(--muted); }

.lead-score {
  font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-2);
}
.lead-estado { font-size: 12px; font-weight: 600; }
.lead-estado.ok { color: var(--ok); }
.lead-estado.err { color: var(--err); }
.lead-estado.proc { color: var(--proc); }

.leads-tabla .acciones { display: flex; gap: 6px; flex-wrap: nowrap; }

/* Prompt para Antigravity */
.prompt-box {
  margin: 0; max-height: 55vh; overflow: auto;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px; line-height: 1.55; color: var(--text);
  white-space: pre-wrap; word-break: break-word;
}

/* Ventanita de contacto */
.cto-list { display: flex; flex-direction: column; gap: 2px; }
.cto-row { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--border); }
.cto-row:last-child { border-bottom: none; }
.cto-row .cto-lbl { flex: 0 0 110px; color: var(--muted); font-size: 12.5px; }
.cto-row a { color: var(--accent-2); text-decoration: none; word-break: break-all; }
.cto-row a:hover { text-decoration: underline; }

/* Botón "Contactado" (tab Seleccionados) y botón verde de acción */
.btn.btn-contactado { background: var(--accent-soft); color: var(--accent-2); border: 1px solid rgba(79, 140, 255, 0.4); }
.btn.btn-contactado:hover { background: rgba(79, 140, 255, 0.24); }
.btn.btn-ok { background: rgba(52, 211, 153, 0.16); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.45); }
.btn.btn-ok:hover { background: rgba(52, 211, 153, 0.26); }

/* Modal de revisión (captura + zoom, tipo Tinder) */
.rev-zoom { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; font-size: 12px; color: var(--muted); }
.rev-body { padding: 0; height: 66vh; overflow: hidden; background: #0b0e13; }
.rev-stage { width: 100%; height: 100%; overflow: auto; }
.rev-stage img { width: 100%; display: block; }
.rev-foot { justify-content: center; gap: 16px; }
.rev-foot .btn { min-width: 150px; }

/* ============ CRM ============ */
.crm-tab {
  background: none; border: none; color: var(--muted);
  padding: 10px 14px; font-size: 14px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.crm-tab:hover { color: var(--text); }
.crm-tab.active { color: var(--accent-2); border-bottom-color: var(--accent); }

.crm-pane { margin-top: 16px; }

/* --- Tablas del CRM (filas compactas, mismo estilo que Ranking) --- */
.crm-tabla { min-width: 860px; }
.crm-tabla .col-estado, .crm-tabla .col-acc { width: 1%; white-space: nowrap; }
.crm-tabla .crm-nom { white-space: nowrap; }
.crm-tabla .acciones { display: flex; gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.crm-ident-nom {
  font-family: ui-monospace, Menlo, monospace; font-size: 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 26ch; display: inline-block; vertical-align: middle;
}
.crm-ident-count { color: var(--muted); font-size: 12px; white-space: nowrap; }

/* Chevron para desplegar identidades */
.crm-chevron {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12px; padding: 0 6px 0 0; line-height: 1;
  transition: transform 0.15s ease;
}
.crm-chevron:hover { color: var(--text); }
.crm-chevron.abierto { transform: rotate(180deg); }

/* Fila desplegable con las identidades del lead */
.crm-drop-row > td { background: var(--surface-2); padding: 8px 14px !important; }
.crm-drop { display: flex; flex-direction: column; gap: 4px; }
.crm-drop-line { display: flex; align-items: center; gap: 4px; }
.crm-drop-line .crm-drop-item { flex: 1; }
.crm-ident-edit {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: var(--radius-sm); flex: none;
}
.crm-ident-edit:hover { color: var(--accent-2); background: var(--surface-3); }
.crm-ident-sep { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.crm-ident-del {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 13px; padding: 2px 6px; border-radius: var(--radius-sm); flex: none;
}
.crm-ident-del:hover { color: var(--err); background: rgba(248, 113, 113, 0.12); }
/* Fila de Mail vencida (contactado sin respuesta pasado el umbral) */
.crm-venc-row td:nth-child(2) { box-shadow: inset 3px 0 0 var(--warn); }
/* Subtítulos del modal de tiempos de espera */
.cfg-sub { margin: 16px 0 6px; font-size: 13px; color: var(--muted); }
.cfg-sub:first-child { margin-top: 0; }

/* Panel de Filtros (Mail / LinkedIn) */
.crm-filtro-wrap { position: relative; display: inline-block; }
#btn-crm-filtros-mail.activo, #btn-crm-filtros-linkedin.activo {
  border-color: var(--accent); color: var(--accent-2);
}
.filtro-n {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px;
  padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; margin-left: 4px;
}
.crm-filtro-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; min-width: 260px; display: flex; flex-direction: column; gap: 8px;
}
.crm-filtro-panel[hidden] { display: none; }   /* el atributo hidden debe ocultarlo */
.ico-eq, .ico-caret { flex: none; }
.ico-caret { opacity: 0.7; margin-left: -2px; }
.crm-filtro-panel label {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  color: var(--text); cursor: pointer;
}
.crm-filtro-panel input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
.crm-filtro-panel .crm-filtro-limpiar { align-self: flex-end; margin-top: 2px; }
.crm-drop-item {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: none; border: 1px solid transparent; border-radius: var(--radius-sm);
  color: var(--text); padding: 6px 10px; cursor: pointer; font-size: 13px;
}
.crm-drop-item:hover { background: var(--surface-3); }
.crm-drop-item.activa { border-color: var(--accent); background: var(--accent-soft); }
.crm-drop-mark { width: 14px; text-align: center; color: var(--muted); }
.crm-drop-mark.si { color: var(--ok); }
.crm-drop-nom { font-family: ui-monospace, Menlo, monospace; font-size: 12px; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-drop-est { color: var(--muted); font-size: 11px; white-space: nowrap; }

.crm-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface-3); color: var(--muted); white-space: nowrap;
}
.crm-badge.nuevo { background: var(--accent-soft); color: var(--accent-2); }
.crm-badge.venc { background: rgba(245, 158, 11, 0.16); color: var(--warn); }
.crm-badge.resp { background: rgba(52, 211, 153, 0.16); color: var(--ok); }

.crm-subtit { margin: 22px 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.crm-agotado-wrap { margin-top: 8px; }

/* Notificaciones (tabla) */
.crm-notif-tabla { min-width: 720px; }
.crm-notif-tabla .crm-n-canal { width: 1%; }
.crm-notif-tabla tr.crm-n-pend td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.crm-notif-canal {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.crm-notif-canal.in { background: #0a66c2; color: #fff; }
.crm-notif-canal.mail { background: var(--surface-3); color: var(--text); }
.crm-n-evento { color: var(--muted); font-size: 13px; max-width: 340px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crm-n-fecha { color: var(--muted); font-size: 12px; white-space: nowrap; width: 1%; }
.crm-notif-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.crm-notif-head .hint { margin: 0; }
.crm-ver-resueltas { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.crm-ver-resueltas input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
.crm-notif-filtros { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crm-fecha { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.crm-fecha input[type="date"] {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 4px 6px;
  font-size: 12px; color-scheme: dark;
}

/* Modal "Ver mensaje" de una notificación */
.crm-ver-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.crm-ver-nom { font-weight: 600; }
.crm-ver-fecha { color: var(--muted); font-size: 12px; }
.crm-ver-texto {
  white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  max-height: 50vh; overflow: auto; line-height: 1.5;
}
.lista-hoy-ta {
  width: 100%; min-height: 240px; resize: vertical;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); padding: 12px 14px;
  font-family: ui-monospace, Menlo, monospace; font-size: 12px; line-height: 1.6;
}
.crm-notif-tipo { color: var(--text); text-transform: capitalize; }
.crm-notif-txt { color: var(--muted); }

/* Sub-tabs LinkedIn (Cola de hoy / Todos) */
.crm-subtabs { display: flex; gap: 6px; margin-bottom: 10px; }
.crm-subtab {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.crm-subtab:hover { color: var(--text); }
.crm-subtab.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-2); }
.crm-subtab .tab-count { margin-left: 4px; }

/* Barra de acciones en bloque del CRM */
.crm-bulk {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
  padding: 8px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.crm-tabla .col-chk { width: 1%; text-align: center; white-space: nowrap; }
.crm-tabla .crm-check, .crm-tabla .crm-check-all { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* Badge de canal (Mail/LinkedIn) en la Cola de trabajo */
.canal-badge {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px;
  vertical-align: middle; white-space: nowrap;
}
.canal-badge.in { background: #0a66c2; color: #fff; }
.canal-badge.mail { background: var(--surface-3); color: var(--text); border: 1px solid var(--border); }

/* Filas de la Cola que vinieron por una respuesta del CRM (¿Vendió?) */
tr.cola-vendible td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.crm-vendio {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted);
  white-space: nowrap;
}
.crm-vendio.si { background: rgba(52, 211, 153, 0.16); border-color: var(--ok); color: var(--ok); }

/* Modal de match de notificaciones */
#match-q {
  width: 100%; padding: 9px 12px; background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
}
.match-list { max-height: 260px; overflow: auto; margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.match-item {
  display: flex; flex-direction: column; gap: 2px; text-align: left; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text); padding: 8px 10px; cursor: pointer;
}
.match-item:hover { background: var(--surface-3); }
.match-item.activa { border-color: var(--accent); background: var(--accent-soft); }
.match-item-url { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-ident { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.match-id { font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.match-estado { display: flex; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 13px; }

/* ============ REPORTES ============ */
.rep-mes { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.rep-mes select {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 6px 10px; font-size: 13px;
}
.rep-historico { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 20px; }
.rep-hist-card {
  flex: 1; min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px;
}
.rep-hist-n { font-size: 30px; font-weight: 700; color: var(--accent-2); }
.rep-hist-l { color: var(--muted); font-size: 13px; margin-top: 2px; }
.rep-hist-l span { opacity: 0.7; }

.rep-titulo { margin: 18px 0 8px; font-size: 15px; }
.rep-tabla { min-width: 720px; font-size: 13px; }
.rep-tabla th, .rep-tabla td { padding: 8px 10px; text-align: right; white-space: nowrap; }
.rep-tabla th:first-child, .rep-tabla td:first-child { text-align: left; }
.rep-tabla thead th { position: sticky; top: 0; z-index: 2; }
.rep-tabla tbody tr:hover { background: var(--surface-2); }
.rep-tabla tr.rep-total td {
  font-weight: 700; color: var(--text);
  border-top: 2px solid var(--border); background: var(--surface-2);
}
.rep-vacio { text-align: center !important; color: var(--muted); padding: 20px !important; }
