/* ============================================================
   Contactos — Diseño alineado con Flujos (gold + dark glass)
   ============================================================ */

#win-contactos {
  --ct-bg:          rgba(12, 12, 18, 0.98);
  --ct-bg-2:        rgba(18, 18, 26, 0.95);
  --ct-card:        rgba(255, 255, 255, 0.03);
  --ct-card-2:      rgba(255, 255, 255, 0.05);
  --ct-line:        rgba(255, 255, 255, 0.07);
  --ct-line-strong: rgba(252, 214, 129, 0.25);
  --ct-text:        #e9e9ee;
  --ct-muted:       rgba(233, 233, 238, 0.5);
  --ct-title:       #fcd681;
  --ct-accent:      #fcd681;
  --ct-accent-soft: rgba(252, 214, 129, 0.12);
  --ct-cyan:        #fcd681;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--ct-text);
}

#win-contactos * { box-sizing: border-box; }

/* ── App shell ── */
#win-contactos .ct-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background:
    radial-gradient(800px 400px at 10% -20%, rgba(252, 214, 129, 0.06), transparent 60%),
    radial-gradient(800px 400px at 90% 110%,  rgba(252, 214, 129, 0.04), transparent 60%),
    rgba(12, 12, 18, 0.98);
}

/* ── Hero bar ── */
#win-contactos .ct-hero {
  border: 1px solid rgba(252, 214, 129, 0.15);
  border-radius: 16px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
  background: rgba(252, 214, 129, 0.04);
  backdrop-filter: blur(12px);
}

#win-contactos .ct-hero-mark {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  border: 1px solid rgba(252, 214, 129, 0.3);
  color: #fcd681;
  display: grid;
  place-items: center;
  font-size: 22px;
  background: rgba(252, 214, 129, 0.08);
}

#win-contactos .ct-hero-copy h2 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
  color: #fcd681;
  font-weight: 800;
  letter-spacing: -0.02em;
}

#win-contactos .ct-hero-copy p {
  margin: 4px 0 0;
  color: var(--ct-muted);
  font-size: 13px;
}

#win-contactos .ct-btn-add {
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(252, 214, 129, 0.4);
  background: linear-gradient(135deg, #fcd681, #f5c542);
  color: #0c0c12;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(252, 214, 129, 0.25);
}

#win-contactos .ct-btn-add:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(252, 214, 129, 0.35);
}

/* ── Toolbar ── */
#win-contactos .ct-toolbar-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}

#win-contactos .ct-topbar { display: none; }

/* ── Search ── */
#win-contactos .ct-search-box { position: relative; }

#win-contactos .ct-toolbar-line .ct-search-box {
  margin-left: auto;
  width: 300px;
  min-width: 240px;
}

#win-contactos .ct-search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ct-muted);
  font-size: 13px;
}

#win-contactos .ct-search-box input {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ct-text);
  padding: 0 12px 0 36px;
  font-size: 13px;
  transition: border-color 0.2s;
}

#win-contactos .ct-search-box input:focus {
  outline: none;
  border-color: rgba(252, 214, 129, 0.4);
  box-shadow: 0 0 0 3px rgba(252, 214, 129, 0.08);
}

#win-contactos .ct-search-box input::placeholder { color: var(--ct-muted); }

/* ── Category strip ── */
#win-contactos .ct-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 58%;
  flex: 0 1 auto;
}

#win-contactos .ct-strip::-webkit-scrollbar { display: none; }

#win-contactos .ct-cat {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ct-muted);
  font-size: 12px;
  padding: 6px 10px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}

#win-contactos .ct-cat:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--ct-text);
}

#win-contactos .ct-cat[draggable="true"] { cursor: grab; }
#win-contactos .ct-cat.dragging { opacity: 0.5; cursor: grabbing; }
#win-contactos .ct-cat.drop-target {
  border-color: rgba(252, 214, 129, 0.5);
  box-shadow: 0 0 0 2px rgba(252, 214, 129, 0.12);
}

#win-contactos .ct-cat.active {
  border-color: rgba(252, 214, 129, 0.4);
  background: rgba(252, 214, 129, 0.12);
  color: #fcd681;
}

#win-contactos .ct-cat-remove {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: transparent;
  color: var(--ct-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s;
}

#win-contactos .ct-cat-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

#win-contactos .ct-cat-remove i { font-size: 10px; }

#win-contactos .ct-cat-add {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px dashed rgba(252, 214, 129, 0.35);
  background: rgba(252, 214, 129, 0.05);
  color: rgba(252, 214, 129, 0.7);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

#win-contactos .ct-cat-add:hover {
  background: rgba(252, 214, 129, 0.12);
  border-color: rgba(252, 214, 129, 0.55);
  color: #fcd681;
}

#win-contactos .ct-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

#win-contactos .ct-sync-btn {
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(252, 214, 129, 0.2);
  background: rgba(252, 214, 129, 0.05);
  color: rgba(252, 214, 129, 0.75);
  padding: 0 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  transition: all 0.15s;
}

#win-contactos .ct-sync-btn:hover {
  background: rgba(252, 214, 129, 0.1);
  border-color: rgba(252, 214, 129, 0.35);
  color: #fcd681;
}

#win-contactos .ct-count-label {
  margin-left: auto;
  color: var(--ct-muted);
  font-size: 12px;
  white-space: nowrap;
}

/* ── Card grid ── */
#win-contactos .ct-results {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-content: start;
}

#win-contactos .ct-results::-webkit-scrollbar { width: 6px; }
#win-contactos .ct-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 10px;
}
#win-contactos .ct-results::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
#win-contactos .ct-results::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ── Contact card ── */
#win-contactos .ct-card {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 460px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#win-contactos .ct-card:hover {
  transform: translateY(-2px);
  border-color: rgba(252, 214, 129, 0.25);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(252, 214, 129, 0.08);
}

#win-contactos .ct-card.active {
  border-color: rgba(252, 214, 129, 0.45);
  box-shadow: 0 0 0 2px rgba(252, 214, 129, 0.12);
}

#win-contactos .ct-card.ct-card-add {
  border-style: dashed;
  border-color: rgba(252, 214, 129, 0.25);
  cursor: pointer;
}

#win-contactos .ct-card.ct-card-add:hover {
  border-color: rgba(252, 214, 129, 0.5);
  background: rgba(252, 214, 129, 0.04);
}

#win-contactos .ct-card.ct-card-add .ct-card-cover {
  background:
    radial-gradient(140% 140% at 0% 0%, rgba(252, 214, 129, 0.15), transparent 55%),
    radial-gradient(140% 140% at 100% 0%, rgba(252, 214, 129, 0.08), transparent 55%),
    rgba(18, 18, 26, 0.95);
}

#win-contactos .ct-avatar-ring-add {
  color: #fcd681;
  font-size: 32px;
}

#win-contactos .ct-card.ct-card-add .ct-card-actions {
  justify-content: center;
}

#win-contactos .ct-card.is-trash { opacity: 0.6; filter: grayscale(0.3); }

/* ── Card cover ── */
#win-contactos .ct-card-cover {
  height: 120px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(120% 120% at 20% -10%, rgba(252, 214, 129, 0.12), transparent 55%),
    radial-gradient(100% 100% at 80% 110%, rgba(252, 214, 129, 0.06), transparent 50%),
    rgba(18, 18, 26, 0.95);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

#win-contactos .ct-card-cover-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#win-contactos .ct-card-panel {
  margin-top: -2px;
  background: transparent;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

/* ── Card tool buttons (top-right) ── */
#win-contactos .ct-card-tools {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  z-index: 3;
}

#win-contactos .ct-card-tools button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(12, 12, 18, 0.65);
  backdrop-filter: blur(8px);
  color: var(--ct-muted);
  cursor: pointer;
  transition: all 0.15s;
}

#win-contactos .ct-card-tools button:hover {
  border-color: rgba(252, 214, 129, 0.35);
  color: #fcd681;
}

#win-contactos .ct-card-tools button.on { color: #fcd681; }

/* ── Avatar ring ── */
#win-contactos .ct-avatar-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  border: 3px solid rgba(252, 214, 129, 0.75);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 20px rgba(252, 214, 129, 0.12);
  display: grid;
  place-items: center;
  margin-top: -64px;
  background: #12121a;
  position: relative;
  z-index: 3;
}

#win-contactos .ct-avatar-ring .ct-av-md {
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 50%;
  border: 0;
  font-size: 28px;
}

/* ── Card head center ── */
#win-contactos .ct-card-head-center {
  margin-top: -10px;
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

#win-contactos .ct-card-title {
  margin: 10px 0 0;
  font-size: 18px;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #e9e9ee;
}

#win-contactos .ct-card-sub {
  margin: 3px 0 0;
  color: var(--ct-muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#win-contactos .ct-role {
  margin: 5px 0 0;
  color: #fcd681;
  font-size: 12px;
  font-weight: 600;
}

#win-contactos .ct-email {
  margin: 5px 0 0;
  color: rgba(233, 233, 238, 0.6);
  font-size: 11px;
  font-weight: 400;
  max-width: 92%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#win-contactos .ct-email a { color: var(--ct-text); text-decoration: none; }
#win-contactos .ct-email a:hover { text-decoration: underline; }

#win-contactos .ct-user-code {
  margin-top: 4px;
  color: #fcd681;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ── Profile fields (rows) ── */
#win-contactos .ct-profile-fields {
  margin: 12px 16px 0;
  display: grid;
  gap: 0;
}

#win-contactos .ct-pf-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

#win-contactos .ct-pf-row span {
  font-size: 10px;
  color: var(--ct-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex: 0 0 auto;
}

#win-contactos .ct-pf-row strong {
  font-size: 13px;
  color: #e9e9ee;
  font-weight: 600;
  line-height: 1.2;
  word-break: break-word;
  text-align: right;
  flex: 1 1 auto;
}

#win-contactos .ct-pf-row strong a { color: var(--ct-text); text-decoration: none; }
#win-contactos .ct-pf-row strong a:hover { text-decoration: underline; }

/* ── Card fields ── */
#win-contactos .ct-card-fields {
  padding: 10px 14px 0;
  display: grid;
  gap: 0;
}

#win-contactos .ct-f-row {
  padding: 8px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#win-contactos .ct-f-row span {
  display: block;
  font-size: 10px;
  color: var(--ct-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#win-contactos .ct-f-row strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  color: #e9e9ee;
  font-weight: 600;
  line-height: 1.25;
  word-break: break-word;
}

#win-contactos .ct-f-row strong a { color: var(--ct-text); text-decoration: none; }
#win-contactos .ct-f-row strong a:hover { text-decoration: underline; }

/* ── Card mid (chips) ── */
#win-contactos .ct-card-mid {
  padding: 12px 14px 0;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

#win-contactos .ct-chip {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(252, 214, 129, 0.25);
  background: rgba(252, 214, 129, 0.08);
  color: rgba(252, 214, 129, 0.85);
  font-weight: 600;
}

#win-contactos .ct-chip.muted {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ct-muted);
}

/* ── Card actions ── */
#win-contactos .ct-card-actions {
  margin-top: auto;
  padding: 10px 14px 14px;
  display: flex;
  justify-content: center;
  gap: 6px;
}

#win-contactos .ct-card-actions button {
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ct-muted);
  cursor: pointer;
  padding: 0 10px;
  font-size: 13px;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#win-contactos .ct-card-actions button.on { color: #fcd681; }
#win-contactos .ct-card-actions button:hover {
  border-color: rgba(252, 214, 129, 0.3);
  color: #fcd681;
  background: rgba(252, 214, 129, 0.06);
}

#win-contactos .ct-plus-btn {
  width: 38px !important;
  height: 38px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--ct-text) !important;
  font-size: 16px;
  display: grid !important;
  place-items: center;
}

#win-contactos .ct-msg-btn {
  width: auto !important;
  min-width: 150px;
  height: 38px !important;
  border-radius: 999px !important;
  border-color: rgba(252, 214, 129, 0.3) !important;
  background: rgba(252, 214, 129, 0.08) !important;
  color: #fcd681 !important;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#win-contactos .ct-msg-btn:hover {
  border-color: rgba(252, 214, 129, 0.5) !important;
  color: #ffe5a0 !important;
  background: rgba(252, 214, 129, 0.14) !important;
}

#win-contactos .ct-profile-btn {
  width: auto !important;
  min-width: 90px;
  height: 38px !important;
  border-radius: 999px !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: var(--ct-text) !important;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#win-contactos .ct-profile-btn:hover {
  border-color: rgba(252, 214, 129, 0.35) !important;
  color: #fcd681 !important;
}

#win-contactos .ct-primary-open {
  width: auto !important;
  min-width: 100px;
  padding: 0 12px;
  border-radius: 999px !important;
  border-color: rgba(252, 214, 129, 0.3) !important;
  background: rgba(252, 214, 129, 0.06) !important;
  color: #fcd681 !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#win-contactos .ct-primary-open:hover {
  border-color: rgba(252, 214, 129, 0.5) !important;
  color: #ffe5a0 !important;
}

#win-contactos .ct-card-body,
#win-contactos .ct-contact-email,
#win-contactos .ct-mini-data { display: none; }

#win-contactos .ct-contact-email a { color: var(--ct-text); text-decoration: none; }
#win-contactos .ct-contact-email a:hover { text-decoration: underline; }

/* ── Mini data ── */
#win-contactos .ct-mini-item {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px;
}

#win-contactos .ct-mini-item span {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ct-muted);
}

#win-contactos .ct-mini-item strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: #e9e9ee;
}

/* ── Empty state ── */
#win-contactos .ct-empty {
  grid-column: 1 / -1;
  min-height: 320px;
  border: 1px dashed rgba(252, 214, 129, 0.2);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
  background: rgba(252, 214, 129, 0.02);
}

#win-contactos .ct-empty-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fcd681;
  background: rgba(252, 214, 129, 0.1);
  font-size: 22px;
  border: 1px solid rgba(252, 214, 129, 0.2);
}

#win-contactos .ct-empty h3 { margin: 0; color: #fcd681; font-size: 22px; font-weight: 700; }
#win-contactos .ct-empty p  { margin: 0; color: var(--ct-muted); font-size: 14px; }

#win-contactos .ct-empty-btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid rgba(252, 214, 129, 0.35);
  background: rgba(252, 214, 129, 0.1);
  color: #fcd681;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

#win-contactos .ct-empty-btn:hover {
  background: rgba(252, 214, 129, 0.18);
  border-color: rgba(252, 214, 129, 0.5);
}

/* ── Avatars ── */
#win-contactos .ct-av {
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  position: relative;
  overflow: hidden;
  border: 2px solid rgba(252, 214, 129, 0.6);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

#win-contactos .ct-av-sm { width: 32px; height: 32px; font-size: 11px; }
#win-contactos .ct-av-md { width: 64px; height: 64px; font-size: 18px; }
#win-contactos .ct-av-lg { width: 72px; height: 72px; font-size: 22px; }
#win-contactos .ct-av-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

/* ── Modal overlay ── */
#win-contactos .ct-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 0;
  z-index: 50;
  opacity: 0;
  transition: opacity 0.2s ease;
  /* pointer-events:none cuando oculto para no bloquear clicks */
  pointer-events: none;
}

#win-contactos .ct-overlay.ct-show {
  opacity: 1;
  pointer-events: auto;
}

#win-contactos .ct-modal-card {
  width: min(760px, 95%);
  max-height: calc(100vh - 28px);
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1a24;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

#win-contactos .ct-modal-head {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15px;
}

#win-contactos .ct-modal-head h3 {
  margin: 0;
  flex: 1;
}

/* Guardar en header */
#win-contactos .ct-modal-head #ct-modal-save {
  flex-shrink: 0;
  margin-left: auto;
}

#win-contactos .ct-modal-x {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: rgba(255, 255, 255, 0.06);
  color: var(--ct-muted);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  display: grid;
  place-items: center;
}

#win-contactos .ct-modal-x:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--ct-text);
}

#win-contactos .ct-modal-body {
  padding: 16px 20px 20px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

#win-contactos .ct-modal-body::-webkit-scrollbar { width: 5px; }
#win-contactos .ct-modal-body::-webkit-scrollbar-track { background: transparent; }
#win-contactos .ct-modal-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

/* ── Editor ── */
#win-contactos .ct-editor { display: flex; flex-direction: column; gap: 10px; }

#win-contactos .ct-locked-note {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(252, 214, 129, 0.25);
  background: rgba(252, 214, 129, 0.07);
  color: rgba(252, 214, 129, 0.9);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
}

#win-contactos .ct-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#win-contactos .ct-form-field { display: flex; flex-direction: column; gap: 5px; }
#win-contactos .ct-form-field label { font-size: 11px; color: var(--ct-muted); font-weight: 600; }
#win-contactos .ct-form-full { grid-column: 1 / -1; }

/* ── Editor preview card ── */
#win-contactos .ct-editor-preview {
  border: 1px solid rgba(252, 214, 129, 0.15);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
}

#win-contactos .ct-editor-preview-cover {
  height: 84px;
  background:
    radial-gradient(120% 120% at 20% -10%, rgba(252, 214, 129, 0.14), transparent 55%),
    rgba(18, 18, 26, 0.95);
}

#win-contactos .ct-editor-preview-body {
  padding: 0 12px 12px;
  text-align: center;
}

#win-contactos .ct-editor-preview-avatar {
  width: 72px;
  height: 72px;
  margin: -38px auto 6px;
  border-radius: 50%;
  border: 3px solid rgba(252, 214, 129, 0.75);
  background: #12121a;
  display: grid;
  place-items: center;
}

#win-contactos .ct-editor-preview-avatar .ct-av-md {
  width: 62px;
  height: 62px;
  min-width: 62px;
  border-radius: 50%;
  border: 0;
}

#win-contactos .ct-editor-preview h4 {
  margin: 5px 0 0;
  font-size: 16px;
  color: #e9e9ee;
  font-weight: 700;
}

#win-contactos .ct-editor-preview p {
  margin: 2px 0 0;
  color: #fcd681;
  font-size: 12px;
}

#win-contactos .ct-editor-preview small {
  display: block;
  margin-top: 3px;
  color: var(--ct-muted);
  font-size: 11px;
}

#win-contactos .ct-editor-preview-lines {
  margin-top: 10px;
  display: grid;
  gap: 4px;
}

#win-contactos .ct-editor-preview-lines div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 4px;
}

#win-contactos .ct-editor-preview-lines span {
  color: var(--ct-muted);
  font-size: 10px;
  text-transform: uppercase;
}

#win-contactos .ct-editor-preview-lines strong {
  color: #e9e9ee;
  font-size: 12px;
  font-weight: 600;
}

/* ── Inputs ── */
#win-contactos .ct-input {
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ct-text);
  padding: 0 10px;
  font-size: 13px;
  transition: border-color 0.2s;
  font-family: inherit;
}

#win-contactos .ct-input:focus {
  outline: none;
  border-color: rgba(252, 214, 129, 0.4);
  box-shadow: 0 0 0 3px rgba(252, 214, 129, 0.07);
}

#win-contactos .ct-input::placeholder { color: var(--ct-muted); }

#win-contactos .ct-input[readonly] {
  opacity: 0.75;
  border-color: rgba(252, 214, 129, 0.2);
  background: rgba(252, 214, 129, 0.04);
  cursor: default;
}

#win-contactos .ct-textarea { min-height: 90px; resize: vertical; padding: 10px; }

/* ── Fixed grid ── */
#win-contactos .ct-fixed-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#win-contactos .ct-fixed-item {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 8px 10px;
}

#win-contactos .ct-fixed-item span {
  display: block;
  font-size: 10px;
  color: var(--ct-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

#win-contactos .ct-fixed-item strong {
  display: block;
  margin-top: 3px;
  color: #e9e9ee;
  font-size: 13px;
  font-weight: 600;
  word-break: break-word;
}

/* ── Form divider ── */
#win-contactos .ct-form-divider {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--ct-muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── KV rows (custom fields) ── */
#win-contactos .ct-kv-list { display: grid; gap: 8px; }

#win-contactos .ct-kv-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
}

#win-contactos .ct-kv-del {
  width: 34px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.1);
  color: #f87171;
  cursor: pointer;
  transition: all 0.15s;
}

#win-contactos .ct-kv-del:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.5);
}

#win-contactos .ct-kv-add-wrap { display: flex; justify-content: flex-start; }

#win-contactos .ct-kv-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#win-contactos .ct-hidden-file { display: none; }

#win-contactos .ct-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Modal buttons ── */
/* ct-modal-foot no se usa (botones están en el header) */

#win-contactos .ct-mbtn {
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ct-text);
  padding: 0 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
  font-family: inherit;
}

#win-contactos .ct-mbtn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.18);
}

#win-contactos .ct-mbtn-primary {
  border-color: rgba(252, 214, 129, 0.4) !important;
  background: linear-gradient(135deg, #fcd681, #f5c542) !important;
  color: #0c0c12 !important;
  font-weight: 800 !important;
}

#win-contactos .ct-mbtn-primary:hover {
  box-shadow: 0 4px 14px rgba(252, 214, 129, 0.3) !important;
  transform: translateY(-1px);
}

#win-contactos .ct-mbtn-danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}

#win-contactos .ct-mbtn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.5);
}

/* ── Mobile density ── */
html[data-cx-mobile-mode="1"] #win-contactos .ct-results {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}

html[data-cx-mobile-mode="1"] #win-contactos .ct-card {
  min-height: 380px;
}

html[data-cx-mobile-mode="1"] #win-contactos .ct-card-cover {
  height: 96px;
}

html[data-cx-mobile-mode="1"] #win-contactos .ct-card-panel {
  min-height: 260px;
}

/* ── Select custom arrow ── */
#win-contactos select.ct-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(252,214,129,0.6)' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
  cursor: pointer;
}

#win-contactos select.ct-input option {
  background-color: #1a1a24;
  color: #e9e9ee;
}

/* ── Textarea ── */
#win-contactos textarea.ct-input {
  height: auto;
  padding: 10px;
  line-height: 1.5;
  font-family: inherit;
  font-size: 13px;
}

/* ── Form danger zone ── */
#win-contactos .ct-form-danger-zone {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(239, 68, 68, 0.15);
  display: flex;
  justify-content: flex-start;
}

/* ── Quick add category buttons ── */
#win-contactos .ct-kv-quick button {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ct-muted);
  cursor: pointer;
  font-size: 11px;
  transition: all 0.15s;
}

#win-contactos .ct-kv-quick button:hover {
  border-color: rgba(252, 214, 129, 0.3);
  color: #fcd681;
  background: rgba(252, 214, 129, 0.06);
}

/* ── Ghost buttons (upload, etc) ── */
#win-contactos .ct-mbtn-ghost {
  border-color: rgba(255, 255, 255, 0.14) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: var(--ct-text) !important;
}

#win-contactos .ct-mbtn-ghost:hover {
  border-color: rgba(252, 214, 129, 0.3) !important;
  background: rgba(252, 214, 129, 0.06) !important;
  color: #fcd681 !important;
}

/* ── Modal: scrollbar ── */
#win-contactos .ct-overlay::-webkit-scrollbar { display: none; }

/* ── Modal: header close btn icon alignment ── */
#win-contactos .ct-modal-x i { pointer-events: none; }

/* ── Labels (form) ── */
#win-contactos .ct-form-field label {
  font-size: 11px;
  color: var(--ct-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
  #win-contactos .ct-toolbar-line {
    flex-wrap: wrap;
  }

  #win-contactos .ct-strip {
    max-width: 100%;
    flex: 1 1 100%;
  }

  #win-contactos .ct-filter-row {
    flex: 1 1 auto;
    flex-wrap: wrap;
  }

  #win-contactos .ct-toolbar-line .ct-search-box {
    width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    margin-left: 0;
  }
}

/* ═══════════════════════════════════════════════════════════
   TEMA CLARO — overrides (se activan SOLO con html[data-theme="light"]).
   Aditivo: no modifica el tema oscuro por defecto. Lo controla el
   selector de Tema en Configuracion > Sistema (Claro/Oscuro/Horario).
   Acento se mantiene en dorado #fcd681 de la app; los textos/fondos
   oscuros pasan a la paleta clara (#eef1f7 / #ffffff / #1e293b).
   ═══════════════════════════════════════════════════════════ */

/* Tokens de la app redefinidos en claro */
html[data-theme="light"] #win-contactos {
  --ct-bg:          #eef1f7;
  --ct-bg-2:        #ffffff;
  --ct-card:        #ffffff;
  --ct-card-2:      rgba(0, 0, 0, .035);
  --ct-line:        rgba(0, 0, 0, .08);
  --ct-line-strong: rgba(252, 214, 129, 0.45);
  --ct-text:        #1e293b;
  --ct-muted:       rgba(30, 41, 59, .6);
}

/* Fondo de la app */
html[data-theme="light"] #win-contactos .ct-app {
  background:
    radial-gradient(800px 400px at 10% -20%, rgba(252, 214, 129, 0.10), transparent 60%),
    radial-gradient(800px 400px at 90% 110%,  rgba(252, 214, 129, 0.06), transparent 60%),
    #eef1f7;
}

/* Hero bar */
html[data-theme="light"] #win-contactos .ct-hero {
  border-color: rgba(0, 0, 0, .08);
  background: rgba(252, 214, 129, 0.10);
}
html[data-theme="light"] #win-contactos .ct-hero-mark {
  border-color: rgba(252, 214, 129, 0.45);
  background: rgba(252, 214, 129, 0.16);
}

/* Search input */
html[data-theme="light"] #win-contactos .ct-search-box input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, .14);
  color: #1e293b;
}

/* Category strip / chips */
html[data-theme="light"] #win-contactos .ct-cat {
  border-color: rgba(0, 0, 0, .08);
  background: rgba(0, 0, 0, .03);
  color: rgba(30, 41, 59, .6);
}
html[data-theme="light"] #win-contactos .ct-cat:hover {
  background: rgba(0, 0, 0, .055);
  border-color: rgba(0, 0, 0, .14);
  color: #1e293b;
}
html[data-theme="light"] #win-contactos .ct-cat.active {
  border-color: rgba(252, 214, 129, 0.5);
  background: rgba(252, 214, 129, 0.22);
  color: #92700f;
}
html[data-theme="light"] #win-contactos .ct-cat-remove {
  border-color: rgba(0, 0, 0, .15);
  color: rgba(30, 41, 59, .6);
}
html[data-theme="light"] #win-contactos .ct-sync-btn {
  border-color: rgba(252, 214, 129, 0.4);
  background: rgba(252, 214, 129, 0.14);
  color: #92700f;
}

/* Card grid scrollbar */
html[data-theme="light"] #win-contactos .ct-results::-webkit-scrollbar-track { background: rgba(0, 0, 0, .04); }
html[data-theme="light"] #win-contactos .ct-results::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); }
html[data-theme="light"] #win-contactos .ct-results::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, .28); }

/* Contact card */
html[data-theme="light"] #win-contactos .ct-card {
  border-color: rgba(0, 0, 0, .08);
  background: #ffffff;
  box-shadow: 0 4px 20px rgba(15, 23, 42, .08);
}
html[data-theme="light"] #win-contactos .ct-card:hover {
  border-color: rgba(252, 214, 129, 0.45);
  box-shadow: 0 8px 28px rgba(15, 23, 42, .14), 0 0 0 1px rgba(252, 214, 129, 0.18);
}
html[data-theme="light"] #win-contactos .ct-card.ct-card-add .ct-card-cover {
  background:
    radial-gradient(140% 140% at 0% 0%, rgba(252, 214, 129, 0.20), transparent 55%),
    radial-gradient(140% 140% at 100% 0%, rgba(252, 214, 129, 0.10), transparent 55%),
    #f3f5fa;
}

/* Card cover */
html[data-theme="light"] #win-contactos .ct-card-cover {
  border-bottom-color: rgba(0, 0, 0, .07);
  background:
    radial-gradient(120% 120% at 20% -10%, rgba(252, 214, 129, 0.18), transparent 55%),
    radial-gradient(100% 100% at 80% 110%, rgba(252, 214, 129, 0.10), transparent 50%),
    #f3f5fa;
}
html[data-theme="light"] #win-contactos .ct-card-panel { border-top-color: rgba(0, 0, 0, .06); }

/* Card tool buttons (top-right) */
html[data-theme="light"] #win-contactos .ct-card-tools button {
  border-color: rgba(0, 0, 0, .12);
  background: rgba(255, 255, 255, 0.82);
  color: rgba(30, 41, 59, .6);
}

/* Avatar ring center */
html[data-theme="light"] #win-contactos .ct-avatar-ring { background: #ffffff; }

/* Card text (titulos / subtitulos / filas) */
html[data-theme="light"] #win-contactos .ct-card-title,
html[data-theme="light"] #win-contactos .ct-pf-row strong,
html[data-theme="light"] #win-contactos .ct-f-row strong,
html[data-theme="light"] #win-contactos .ct-mini-item strong,
html[data-theme="light"] #win-contactos .ct-fixed-item strong,
html[data-theme="light"] #win-contactos .ct-editor-preview h4,
html[data-theme="light"] #win-contactos .ct-editor-preview-lines strong { color: #1e293b; }
html[data-theme="light"] #win-contactos .ct-email { color: rgba(30, 41, 59, .6); }
html[data-theme="light"] #win-contactos .ct-email a,
html[data-theme="light"] #win-contactos .ct-pf-row strong a,
html[data-theme="light"] #win-contactos .ct-f-row strong a,
html[data-theme="light"] #win-contactos .ct-contact-email a { color: #1e293b; }

/* Filas / divisores con borde blanco -> oscuro */
html[data-theme="light"] #win-contactos .ct-pf-row,
html[data-theme="light"] #win-contactos .ct-f-row,
html[data-theme="light"] #win-contactos .ct-editor-preview-lines div,
html[data-theme="light"] #win-contactos .ct-form-divider { border-color: rgba(0, 0, 0, .08); }

/* Chip muted */
html[data-theme="light"] #win-contactos .ct-chip.muted {
  border-color: rgba(0, 0, 0, .1);
  background: rgba(0, 0, 0, .04);
  color: rgba(30, 41, 59, .6);
}

/* Card action buttons */
html[data-theme="light"] #win-contactos .ct-card-actions button {
  border-color: rgba(0, 0, 0, .1);
  background: rgba(0, 0, 0, .035);
  color: rgba(30, 41, 59, .6);
}
html[data-theme="light"] #win-contactos .ct-card-actions button:hover {
  border-color: rgba(252, 214, 129, 0.45);
  color: #92700f;
  background: rgba(252, 214, 129, 0.14);
}
html[data-theme="light"] #win-contactos .ct-plus-btn,
html[data-theme="light"] #win-contactos .ct-profile-btn {
  border-color: rgba(0, 0, 0, .12) !important;
  background: rgba(0, 0, 0, .035) !important;
  color: #1e293b !important;
}
html[data-theme="light"] #win-contactos .ct-msg-btn,
html[data-theme="light"] #win-contactos .ct-primary-open {
  border-color: rgba(252, 214, 129, 0.55) !important;
  background: rgba(252, 214, 129, 0.18) !important;
  color: #92700f !important;
}
html[data-theme="light"] #win-contactos .ct-msg-btn:hover,
html[data-theme="light"] #win-contactos .ct-primary-open:hover {
  border-color: rgba(252, 214, 129, 0.7) !important;
  background: rgba(252, 214, 129, 0.26) !important;
  color: #7a5e0c !important;
}

/* Mini-item / fixed-item / editor preview cards */
html[data-theme="light"] #win-contactos .ct-mini-item,
html[data-theme="light"] #win-contactos .ct-fixed-item {
  border-color: rgba(0, 0, 0, .08);
  background: rgba(0, 0, 0, .025);
}
html[data-theme="light"] #win-contactos .ct-editor-preview {
  border-color: rgba(252, 214, 129, 0.3);
  background: rgba(0, 0, 0, .02);
}
html[data-theme="light"] #win-contactos .ct-editor-preview-cover {
  background:
    radial-gradient(120% 120% at 20% -10%, rgba(252, 214, 129, 0.20), transparent 55%),
    #f3f5fa;
}
html[data-theme="light"] #win-contactos .ct-editor-preview-avatar { background: #ffffff; }

/* Empty state */
html[data-theme="light"] #win-contactos .ct-empty {
  border-color: rgba(252, 214, 129, 0.4);
  background: rgba(252, 214, 129, 0.06);
}
html[data-theme="light"] #win-contactos .ct-empty-icon {
  background: rgba(252, 214, 129, 0.18);
  border-color: rgba(252, 214, 129, 0.4);
}

/* Modal overlay / card / menus */
html[data-theme="light"] #win-contactos .ct-overlay { background: rgba(15, 23, 42, .35); }
html[data-theme="light"] #win-contactos .ct-modal-card {
  border-color: rgba(0, 0, 0, .1);
  background: #ffffff !important;
  box-shadow: 0 25px 50px rgba(15, 23, 42, .25);
}
html[data-theme="light"] #win-contactos .ct-modal-head { border-bottom-color: rgba(0, 0, 0, .08); }
html[data-theme="light"] #win-contactos .ct-modal-x {
  background: rgba(0, 0, 0, .05);
  color: rgba(30, 41, 59, .6);
}
html[data-theme="light"] #win-contactos .ct-modal-x:hover {
  background: rgba(0, 0, 0, .1);
  color: #1e293b;
}
html[data-theme="light"] #win-contactos .ct-modal-body::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, .18); }

/* Inputs / selects / textareas */
html[data-theme="light"] #win-contactos .ct-input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, .14);
  color: #1e293b;
}
html[data-theme="light"] #win-contactos .ct-input[readonly] {
  border-color: rgba(252, 214, 129, 0.4);
  background: rgba(252, 214, 129, 0.08);
}
html[data-theme="light"] #win-contactos select.ct-input option {
  background-color: #ffffff;
  color: #1e293b;
}

/* Modal buttons (ghost / neutral) */
html[data-theme="light"] #win-contactos .ct-mbtn {
  border-color: rgba(0, 0, 0, .12);
  background: rgba(0, 0, 0, .035);
  color: #1e293b;
}
html[data-theme="light"] #win-contactos .ct-mbtn:hover {
  background: rgba(0, 0, 0, .06);
  border-color: rgba(0, 0, 0, .18);
}
html[data-theme="light"] #win-contactos .ct-mbtn-ghost {
  border-color: rgba(0, 0, 0, .12) !important;
  background: rgba(0, 0, 0, .04) !important;
  color: #1e293b !important;
}
html[data-theme="light"] #win-contactos .ct-mbtn-ghost:hover {
  border-color: rgba(252, 214, 129, 0.45) !important;
  background: rgba(252, 214, 129, 0.14) !important;
  color: #92700f !important;
}

/* Quick add category buttons */
html[data-theme="light"] #win-contactos .ct-kv-quick button {
  border-color: rgba(0, 0, 0, .1);
  background: rgba(0, 0, 0, .035);
  color: rgba(30, 41, 59, .6);
}
html[data-theme="light"] #win-contactos .ct-kv-quick button:hover {
  border-color: rgba(252, 214, 129, 0.45);
  color: #92700f;
  background: rgba(252, 214, 129, 0.14);
}

/* Bordes restantes con rgba blanca */
html[data-theme="light"] #win-contactos .ct-form-danger-zone { border-color: rgba(239, 68, 68, 0.2); }
