/* ==========================================================================
 * 07-listas.css · parte 7/11 — Listas de seguimiento (popover y sección)
 * Orden de carga obligatorio (reproduce la cascada del styles.css original).
 * No reordenar los <link> ni mover reglas entre partes sin revisar la cascada.
 * ========================================================================== */


.watch-popover {
  position: fixed;
  z-index: 1200;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
  color: var(--ink);
  font-size: 12.5px;
}

.watch-popover-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.watch-popover-head strong { display: block; font-size: 12.5px; }

.watch-popover-sub { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.watch-popover-close { border: 0; background: transparent; color: var(--muted-2); font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; }
.watch-popover-close:hover { color: var(--ink); }

.watch-popover-list { max-height: min(320px, 45vh); overflow-y: auto; padding: 5px; overscroll-behavior: contain; }
.watch-popover-list::-webkit-scrollbar { width: 8px; }
.watch-popover-list::-webkit-scrollbar-thumb { background: var(--line-mid); border-radius: 4px; }
.watch-popover-list::-webkit-scrollbar-thumb:hover { background: #b5b5b5; }

.watch-popover-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.watch-popover-row:hover { background: #f6f6f6; }
.watch-popover-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.watch-popover-check {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  border: 1.5px solid #ccc;
  border-radius: 4px;
  color: #fff;
}
.watch-popover-check svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.4; }
.watch-popover-row.checked .watch-popover-check { background: var(--accent); border-color: var(--accent); }

.watch-popover-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-popover-row.checked .watch-popover-name { color: var(--accent-dark); }

.watch-popover-count { color: var(--muted); font-size: 11px; white-space: nowrap; }

.watch-popover-delete {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b5b5b5;
  cursor: pointer;
}
.watch-popover-delete:hover { background: var(--red-bg); color: var(--red); }
.watch-popover-delete svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.watch-popover-delete.armed {
  width: auto;
  padding: 0 9px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}
.watch-popover-delete.armed:hover { background: #d33; color: #fff; }

.watch-popover-empty { padding: 14px 10px; color: var(--muted); text-align: center; }

.watch-popover-create {
  display: flex;
  gap: 6px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line-soft);
}

.watch-popover-create-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--line-mid);
  border-radius: 5px;
  font-size: 12px;
  color: var(--ink);
}
.watch-popover-create-input:focus { border-color: var(--accent); outline: none; }

.watch-popover-create-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.watch-popover-create-btn:hover:not(:disabled) { background: var(--accent-dark); }
.watch-popover-create-btn:disabled { opacity: .5; cursor: default; }

.watch-popover-calendar-section {
  padding: 4px 6px;
  border-top: 1px solid var(--line-soft);
  margin-top: 2px;
}

.watch-popover-calendar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-soft2);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.watch-popover-calendar-row:hover {
  background: var(--info-bg);
  border-color: var(--info-border);
}

.watch-popover-calendar-row.checked {
  background: var(--info-bg);
  border-color: var(--info-border);
}

.watch-popover-calendar-row.checked .watch-popover-check {
  background: var(--info-solid);
  border-color: var(--info-solid);
}

.watch-popover-calendar-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}

.watch-popover-calendar-title {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-2);
}

.watch-popover-calendar-row.checked .watch-popover-calendar-title {
  color: var(--info-text);
}

.watch-popover-calendar-desc {
  font-size: 10px;
  color: var(--muted);
  margin-top: 1px;
}

.watch-popover-calendar-row.locked {
  cursor: not-allowed;
  background: var(--surface-2);
  border-color: var(--line-mid);
  opacity: 0.95;
}

.watch-popover-calendar-row.locked:hover {
  background: var(--surface-2);
  border-color: var(--line-mid);
}

.watch-popover-calendar-row.locked .watch-popover-check {
  background: var(--info-solid);
  border-color: var(--info-solid);
}

.watch-popover-calendar-row.locked .watch-popover-calendar-title {
  color: var(--ink-2);
}

.watch-popover-cal-badge-held {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--info-bg);
  border: 1px solid var(--info-border);
  color: var(--info-text);
  font-size: 9.5px;
  font-weight: 700;
  margin-left: 4px;
}

.watch-popover-lock-icon {
  font-size: 11px;
  opacity: 0.7;
  margin-left: auto;
}

.watch-popover-email-section {
  padding: 4px 6px 6px;
  border-top: 1px dashed var(--line-soft2);
  margin-top: 2px;
}

.watch-popover-email-main {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-soft2);
  background: var(--surface-2);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.watch-popover-email-main:hover {
  background: var(--info-bg);
  border-color: var(--info-border);
}

.watch-popover-email-main.checked {
  background: var(--green-bg);
  border-color: #86efac;
}

.watch-popover-email-main.checked .watch-popover-check {
  background: #059669;
  border-color: var(--green-text);
}

.watch-popover-email-main.checked .watch-popover-calendar-title {
  color: #047857;
}

.watch-popover-email-subs {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 5px 4px 2px 18px;
  transition: all 0.2s ease;
}

.watch-popover-email-subs.collapsed {
  display: none;
}

.watch-popover-sub-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3.5px 6px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 11px;
  color: var(--muted-strong);
  user-select: none;
  transition: background 0.12s ease;
}

.watch-popover-sub-item:hover {
  background: var(--surface-3);
  color: var(--ink);
}

.watch-popover-sub-item.checked {
  color: var(--ink);
  font-weight: 600;
}

.watch-popover-sub-check {
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--line-mid);
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.watch-popover-sub-check svg {
  width: 9px;
  height: 9px;
  stroke: #fff;
  stroke-width: 2.8;
  fill: none;
}

.watch-popover-sub-item.checked .watch-popover-sub-check {
  background: #059669;
  border-color: var(--green-text);
}

.watch-popover-sub-label {
  flex: 1;
  font-size: 10.5px;
  line-height: 1.2;
}

/* ── Sección de listas de seguimiento ───────────────────────── */

.watch-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.watch-section-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--line-mid);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.watch-section-chip:hover { border-color: var(--accent); }
.watch-section-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.watch-section-chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.watch-section-chip-name { font-weight: 700; }

.watch-section-chip-count {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}
.watch-section-chip.active .watch-section-chip-count { background: var(--accent); color: #fff; }

.watch-section-chip-delete {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: #b5b5b5;
}
.watch-section-chip-delete:hover { background: var(--red-bg); color: var(--red); }
.watch-section-chip-delete svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.watch-section-chip-delete.armed {
  width: auto;
  padding: 0 7px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
}
.watch-section-chip-delete.armed:hover { background: #d33; color: #fff; }

.watch-section-create {
  display: flex;
  gap: 6px;
}

.watch-section-create-input {
  width: 150px;
  padding: 6px 9px;
  border: 1px solid var(--line-mid);
  border-radius: 16px;
  font-size: 12px;
  color: var(--ink);
}
.watch-section-create-input:focus { border-color: var(--accent); outline: none; }

.watch-section-create-btn {
  padding: 6px 12px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.watch-section-create-btn:hover:not(:disabled) { background: var(--accent-dark); }
.watch-section-create-btn:disabled { opacity: .5; cursor: default; }

.watch-section-empty {
  padding: 22px 16px;
  border: 1px dashed var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

/* ── Cartera ────────────────────────────────────────────────── */
