@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap");

:root {
  --bg: #030014;
  --card: rgba(17, 0, 24, 0.75);
  --card2: rgba(22, 0, 31, 0.65);
  --border: rgba(180, 0, 230, 0.25);
  --border-bright: rgba(220, 0, 255, 0.45);
  --accent: #7C3AED;
  --accent2: #4F46E5;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --text: #f8f2ff;
  --text2: #d8cce6;
  --muted: #947da6;
  --danger: #7C3AED;
  --success: #10b981;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(192, 38, 211, 0.12) 0%, transparent 40%);
  background-attachment: fixed;
}

.panel {
  width: min(1600px, calc(100vw - 40px));
  margin: 32px auto;
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 40px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 1px var(--border);
}

/* ── HEADER ─────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.app-logo {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent2) 0%, var(--accent) 100%);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--accent-glow);
}

.app-title h1 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(90deg, #e879f9, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-title p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ── SESSION ROW ────────────────────────────────────── */
.session-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  background: rgba(124, 58, 237, 0.07);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

/* ── STATUS PILL ────────────────────────────────────── */
.status-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px dashed rgba(180, 0, 230, 0.3);
  background: linear-gradient(180deg, rgba(120, 0, 180, 0.09), rgba(120, 0, 180, 0.05));
  color: var(--text2);
  font-size: 13px;
  min-height: 40px;
  margin: 12px 0;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.status-dot.active {
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* ── LINKED BANNER ──────────────────────────────────── */
.linked-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(16, 185, 129, 0.28);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(124, 58, 237, 0.08)),
    rgba(124, 58, 237, 0.08);
  border-radius: 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.linked-banner strong {
  color: #d8b4fe;
  font-size: 14px;
}

.linked-banner span {
  color: #d1fae5;
  font-size: 13px;
}

/* ── QR BLOCK ────────────────────────────────────────── */
.qr-block {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(120, 0, 180, 0.06), rgba(120, 0, 180, 0.03)),
    rgba(120, 0, 180, 0.04);
  margin: 16px 0;
}

#pairQr {
  width: 160px;
  height: 160px;
  background: white;
  border-radius: 10px;
  padding: 6px;
}

.pairing-data {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.qr-block.is-linked {
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 12px;
  border-color: rgba(16, 185, 129, 0.26);
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(124, 58, 237, 0.05)),
    rgba(120, 0, 180, 0.04);
}

.qr-block.is-linked > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.qr-block.is-linked .pairing-data {
  grid-template-columns: 1fr;
  align-items: start;
  gap: 10px 12px;
}

/* ── FORM CONTROLS ──────────────────────────────────── */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

input {
  background: rgba(10, 0, 20, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 38, 211, 0.15);
}

textarea {
  background: rgba(10, 0, 20, 0.6);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(192, 38, 211, 0.15);
}

input {
  min-width: 160px;
}

#pairLink {
  width: 100%;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  transition: filter 0.2s, transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(192, 38, 211, 0.25);
}

button:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 20px rgba(192, 38, 211, 0.4);
}

button:active {
  transform: scale(0.97);
}

button.secondary {
  background: rgba(120, 0, 180, 0.12);
  border: 1px solid var(--border);
  color: var(--text2);
  box-shadow: none;
}

button.danger {
  background: linear-gradient(135deg, #4338CA, #7C3AED);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

button.danger:hover {
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
}

button.danger-soft {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #f87171;
  box-shadow: none;
}

button.icon-btn {
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
}

button.icon-btn.active-mute {
  background: linear-gradient(135deg, #4338CA, #7C3AED);
  box-shadow: 0 2px 14px rgba(124, 58, 237, 0.45);
}

/* ── CONTACTS ────────────────────────────────────────── */
.contacts {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.campaign-panel {
  margin: 8px 0 18px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 0 0, rgba(79, 70, 229, 0.16), transparent 34%),
    radial-gradient(circle at 100% 0, rgba(236, 72, 153, 0.12), transparent 30%),
    rgba(120, 0, 180, 0.05);
}

.campaign-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #22d3ee, #8b5cf6, #ec4899, #f59e0b);
  background-size: 200% 100%;
  animation: campaign-gradient 7s linear infinite;
}

.campaign-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.campaign-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.campaign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.campaign-card {
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(124, 58, 237, 0.1), rgba(3, 0, 20, 0.38));
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.campaign-card:nth-child(1) { border-color: rgba(34, 211, 238, 0.28); }
.campaign-card:nth-child(2) { border-color: rgba(167, 139, 250, 0.32); }
.campaign-card:nth-child(3) { border-color: rgba(244, 114, 182, 0.28); }

.campaign-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 14px 35px rgba(3, 0, 20, 0.35), 0 0 24px rgba(124, 58, 237, 0.12);
}

.campaign-card-wide {
  grid-column: span 2;
}

.campaign-card h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: var(--text2);
}

.campaign-metric {
  font-size: 28px;
  font-weight: 700;
  color: #d8b4fe;
  margin-bottom: 10px;
}

.campaign-counters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.campaign-counter {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: rgba(120, 0, 180, 0.08);
  animation: campaign-card-pop 0.35s ease both;
  transition: transform 0.2s ease, background 0.2s ease;
}

.campaign-counter:hover { transform: translateY(-2px); background: rgba(124, 58, 237, 0.16); }
.campaign-counter:nth-child(2) { animation-delay: 35ms; }
.campaign-counter:nth-child(3) { animation-delay: 70ms; }
.campaign-counter:nth-child(4) { animation-delay: 105ms; }
.campaign-counter:nth-child(5) { animation-delay: 140ms; }
.campaign-counter:nth-child(6) { animation-delay: 175ms; }
.campaign-counter:nth-child(7) { animation-delay: 210ms; }

.campaign-counter span {
  font-size: 12px;
  color: var(--muted);
}

.campaign-counter strong {
  font-size: 18px;
}

.campaign-counter.warn strong {
  color: #fbbf24;
}

.campaign-counter.ok strong {
  color: #86efac;
}

.campaign-counter.accent strong {
  color: #c084fc;
}

.campaign-counter.danger strong {
  color: #fb7185;
}

.worker-chip,
.callback-item,
.campaign-active-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
  background: rgba(120, 0, 180, 0.08);
}

.worker-chip {
  margin-bottom: 8px;
}

.worker-chip strong,
.callback-item strong,
.campaign-active-card strong {
  font-size: 13px;
}

.worker-chip span,
.callback-item span,
.campaign-active-card span {
  color: var(--text2);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.worker-chip small,
.callback-item small,
.campaign-active-card small {
  color: var(--muted);
  font-size: 12px;
}

.worker-chip.is-active {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.12);
  animation: worker-active-glow 1.8s ease-in-out infinite;
}

.callback-card {
  margin-top: 12px;
}

.callback-item {
  margin-top: 8px;
}

.callback-item.is-completed {
  opacity: 0.65;
}

.campaign-list-empty {
  color: var(--muted);
  font-size: 13px;
}

.campaign-result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.campaign-status-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  border: 1px solid rgba(168, 85, 247, 0.35);
  background: rgba(120, 0, 180, 0.18);
  color: #d8b4fe;
}

.campaign-status-chip.state-dialing,
.campaign-status-chip.state-ringing,
.campaign-status-chip.state-in_call {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.15);
}

.campaign-status-chip.state-completed,
.campaign-status-chip.state-agendado {
  color: #86efac;
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.15);
}

.campaign-status-chip.state-awaiting_callback,
.campaign-status-chip.state-requiere_asesor {
  color: #c084fc;
}

.campaign-status-chip.state-failed,
.campaign-status-chip.state-sin_respuesta {
  color: #fda4af;
  border-color: rgba(124, 58, 237, 0.4);
  background: rgba(124, 58, 237, 0.12);
}

.agent-panel-head {
  align-items: flex-start;
  gap: 14px;
}

.callback-item {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 4px;
  transition: all 0.2s ease;
}

.callback-item:hover {
  background: rgba(124, 58, 237, 0.12);
  border-color: var(--accent);
}

.callback-item.is-completed {
  opacity: 0.6;
  filter: grayscale(0.5);
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.1);
}

.callback-item strong {
  color: var(--text);
  font-size: 14px;
}

.callback-item span {
  font-family: monospace;
  color: var(--accent);
  font-size: 13px;
}

.callback-item small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.agent-grid textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
}

.agent-activity {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.agent-log-card {
  border: 1px solid rgba(116, 255, 233, 0.12);
  border-radius: 16px;
  background: rgba(10, 21, 52, 0.42);
  padding: 14px;
}

.agent-log-empty,
.agent-log-text {
  margin-top: 8px;
  min-height: 72px;
  color: #e9d8ff;
  line-height: 1.45;
  white-space: pre-wrap;
}

tbody tr.contact-row-campaign-active,
tbody tr.contact-row-campaign-active:hover {
  background: rgba(16, 185, 129, 0.14);
}

.contacts h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text2);
  margin-bottom: 12px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

thead tr {
  background: rgba(124, 58, 237, 0.07);
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr:hover {
  background: rgba(120, 0, 180, 0.06);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr.contact-row-calling {
  background: rgba(245, 158, 11, 0.2);
}

tbody tr.contact-row-calling td {
  border-bottom-color: rgba(245, 158, 11, 0.45);
}

tbody tr.contact-row-called {
  background: rgba(245, 158, 11, 0.18);
}

tbody tr.contact-row-called td {
  border-bottom-color: rgba(245, 158, 11, 0.35);
}

tbody tr.contact-row-answered,
tbody tr.contact-row-answered:hover {
  background: rgba(16, 185, 129, 0.12) !important;
}

tbody tr.contact-row-answered td {
  border-bottom-color: rgba(16, 185, 129, 0.25);
}

tbody tr.contact-row-status-r,
tbody tr.contact-row-status-r:hover {
  background: rgba(220, 38, 38, 0.2);
}

tbody tr.contact-row-status-r td {
  border-bottom-color: rgba(220, 38, 38, 0.38);
}

tbody tr.contact-row-status-lc,
tbody tr.contact-row-status-lc:hover {
  background: rgba(245, 158, 11, 0.22);
}

tbody tr.contact-row-status-lc td {
  border-bottom-color: rgba(245, 158, 11, 0.45);
}

tbody tr.contact-row-status-sc,
tbody tr.contact-row-status-sc:hover,
tbody tr.contact-row-active-in-call,
tbody tr.contact-row-active-in-call:hover {
  background: rgba(16, 185, 129, 0.24) !important;
}

tbody tr.contact-row-active-call,
tbody tr.contact-row-active-call:hover {
  background: rgba(245, 158, 11, 0.24) !important;
}

tbody tr.contact-row-status-sc td,
tbody tr.contact-row-active-in-call td {
  border-bottom-color: rgba(16, 185, 129, 0.4);
}

.call-count-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.28);
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.duration-chip {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.actions-cell {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.actions-cell button {
  font-size: 12px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 8px;
}

.actions-cell .wa-action-btn {
  background: linear-gradient(135deg, #1b8f44, #25d366);
  border: 1px solid rgba(37, 211, 102, 0.55);
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(37, 211, 102, 0.3);
}

.contact-action-badges {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-radius: 999px;
  background: transparent;
  border: none;
}

.contact-action-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  background: #ffffff;
  border: none;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.contact-action-badge:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.contact-action-badge.is-active {
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 8px 16px rgba(0, 0, 0, 0.3);
}

.contact-action-badge.badge-r {
  color: #ef4444;
}

.contact-action-badge.badge-r.is-active {
  background: #dc2626;
  color: #ffffff;
}

.contact-action-badge.badge-lc {
  color: #f59e0b;
}

.contact-action-badge.badge-lc.is-active {
  background: #f59e0b;
  color: #ffffff;
}

.contact-action-badge.badge-sc {
  color: #22c55e;
}

.contact-action-badge.badge-sc.is-active {
  background: #16a34a;
  color: #ffffff;
}

.contact-status-legend {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(124, 58, 237, 0.08);
}

/* Vinculación por espacios: un código QR independiente por teléfono. */
#qrBlock.qr-block {
  display: block !important;
  padding: 26px;
  min-height: 0;
}

.pairing-slots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.pairing-slots-head .qr-description {
  margin-top: 5px;
}

#addPairingQrBtn {
  min-width: 132px;
}

.pairing-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.pairing-slot-card {
  min-height: 350px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(236, 0, 179, 0.42);
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(36, 3, 66, 0.52), rgba(75, 3, 82, 0.38));
  box-shadow: 0 14px 30px rgba(10, 0, 28, 0.18), inset 0 1px rgba(255,255,255,0.05);
}

.pairing-slot-card.is-assigned {
  border-color: rgba(44, 225, 165, 0.50);
}

.pairing-slot-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pairing-slot-top strong {
  font-size: 17px;
}

.pairing-slot-state {
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff !important;
  background: rgba(18, 1, 37, 0.62);
  border: 1px solid rgba(255,255,255,0.12);
  font-size: 11px;
  font-weight: 700;
}

.pairing-slot-qr {
  width: min(210px, 82%);
  aspect-ratio: 1;
  padding: 8px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 13px 28px rgba(7, 0, 22, 0.30);
}

.pairing-slot-card small {
  min-height: 18px;
  color: var(--muted) !important;
  text-align: center;
}

.pairing-slot-details,
.pairing-slot-current-call {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(19, 2, 40, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.09);
  text-align: left;
}

.pairing-slot-details span,
.pairing-slot-current-call span {
  color: rgba(255, 255, 255, 0.64) !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.pairing-slot-details strong + span {
  margin-top: 7px;
}

.pairing-slot-current-call.is-calling {
  border-color: rgba(44, 225, 165, 0.48);
  box-shadow: inset 3px 0 rgba(44, 225, 165, 0.85);
}

.pairing-slot-current-call .pairing-call-number {
  width: 100%;
  text-align: center;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.15;
  letter-spacing: 0.045em;
  overflow-wrap: anywhere;
}

.pairing-slot-current-call .pairing-call-company {
  width: 100%;
  min-height: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.88) !important;
}

@keyframes phone-panel-vibration {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-2px) rotate(-0.25deg); }
  40% { transform: translateX(2px) rotate(0.25deg); }
  60% { transform: translateX(-1px) rotate(-0.15deg); }
  80% { transform: translateX(1px) rotate(0.15deg); }
}

@keyframes call-icon-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 8px rgba(30, 42, 255, 0.28)); }
  50% { transform: scale(1.13); filter: drop-shadow(0 7px 15px rgba(86, 116, 255, 0.58)); }
}

@keyframes call-state-border-motion {
  0%, 100% { transform: translateX(0) scale(1); opacity: 0.78; }
  8% { transform: translateX(-1.5px) scale(1.004); }
  16% { transform: translateX(1.5px) scale(1.007); }
  24% { transform: translateX(-1px) scale(1.01); }
  32% { transform: translateX(1px) scale(1.013); }
  50% { transform: translateX(0) scale(1.018); opacity: 1; }
  72% { transform: translateX(0) scale(1.008); opacity: 0.88; }
}

.pairing-slot-current-call.is-ringing,
.pairing-slot-current-call.is-answered,
.pairing-slot-current-call.is-ended {
  position: relative;
  isolation: isolate;
  --call-state-border: rgba(255, 255, 255, 0.72);
}

.pairing-slot-current-call.is-ringing { --call-state-border: rgba(106, 255, 187, 0.96); }
.pairing-slot-current-call.is-answered { --call-state-border: rgba(255, 115, 221, 0.96); }
.pairing-slot-current-call.is-ended { --call-state-border: rgba(255, 105, 139, 0.94); }

.pairing-slot-current-call.is-ringing::after,
.pairing-slot-current-call.is-answered::after,
.pairing-slot-current-call.is-ended::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: -2px;
  border: 2px solid var(--call-state-border);
  border-radius: 15px;
  pointer-events: none;
  box-shadow: 0 0 14px color-mix(in srgb, var(--call-state-border) 55%, transparent);
  animation: call-state-border-motion 1.15s ease-in-out infinite;
  transform-origin: center;
}

.pairing-slot-current-call.is-ringing {
  color: #ffffff;
  background: rgba(19, 2, 40, 0.86);
  border-color: rgba(106, 255, 187, 0.92);
  box-shadow: inset 0 0 0 1px rgba(44, 225, 165, 0.28), 0 0 18px rgba(24, 218, 130, 0.24);
}

.pairing-call-number-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.pairing-call-number-row .pairing-call-number {
  width: auto;
  min-width: 0;
}

.pairing-call-status-icon {
  width: clamp(38px, 4.2vw, 54px);
  height: clamp(38px, 4.2vw, 54px);
  flex: 0 0 auto;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
}

.pairing-call-status-icon.is-vibrating {
  animation: phone-panel-vibration 0.34s linear infinite;
}

.pairing-call-status-icon.is-pulsing {
  animation: call-icon-pulse 1.05s ease-in-out infinite;
}

.pairing-call-status-icon.is-rejected {
  filter: drop-shadow(0 5px 11px rgba(255, 55, 104, 0.42));
}

.pairing-slot-current-call.is-answered {
  background: rgba(19, 2, 40, 0.86);
  border-color: rgba(255, 115, 221, 0.94);
  box-shadow: inset 0 0 0 1px rgba(237, 0, 181, 0.3), 0 0 18px rgba(237, 0, 181, 0.25);
}

.pairing-slot-current-call.is-ended {
  background: rgba(19, 2, 40, 0.86);
  border-color: rgba(255, 105, 139, 0.9);
  box-shadow: inset 0 0 0 1px rgba(234, 42, 92, 0.3), 0 0 18px rgba(234, 42, 92, 0.24);
}

.pairing-slot-current-call.is-ringing span,
.pairing-slot-current-call.is-answered span,
.pairing-slot-current-call.is-ended span,
.pairing-slot-current-call.is-ringing .pairing-call-company,
.pairing-slot-current-call.is-answered .pairing-call-company,
.pairing-slot-current-call.is-ended .pairing-call-company {
  color: #ffffff !important;
}

.pairing-slot-current-call .pairing-call-number {
  margin-top: 7px;
}

.pairing-slot-current-call .pairing-call-company {
  padding: 7px 4px 5px;
  line-height: 1.35;
}

@media (prefers-reduced-motion: reduce) {
  .pairing-call-status-icon.is-vibrating,
  .pairing-call-status-icon.is-pulsing,
  .pairing-slot-current-call.is-ringing::after,
  .pairing-slot-current-call.is-answered::after,
  .pairing-slot-current-call.is-ended::after { animation: none; }
}

.pending-turn-panel {
  width: 100%;
  margin-top: 20px;
  padding: 20px;
  border: 1px solid rgba(236, 0, 179, 0.82);
  border-radius: 20px;
  background: rgba(25, 1, 47, 0.45);
  box-shadow: 0 12px 28px rgba(43, 0, 57, 0.18);
}

.pending-turn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.pending-turn-head span {
  color: #f08bdf !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.pending-turn-head h3 {
  margin: 5px 0 0;
  font-size: 22px;
}

.pending-turn-head > strong {
  padding: 8px 13px;
  border: 1px solid rgba(255, 79, 208, 0.5);
  border-radius: 999px;
  background: rgba(208, 0, 159, 0.2);
}

.pending-turn-table-wrap {
  overflow-x: auto;
  border-radius: 15px;
  border: 1px solid rgba(236, 0, 179, 0.55);
}

.pending-turn-table-wrap table {
  width: 100%;
  min-width: 600px;
  border-collapse: collapse;
}

.pending-turn-table-wrap th,
.pending-turn-table-wrap td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pending-turn-table-wrap th {
  background: rgba(112, 9, 127, 0.82);
  font-size: 12px;
}

.pending-turn-table-wrap tr:last-child td { border-bottom: 0; }
.pending-turn-empty { text-align: center !important; color: var(--muted) !important; }

.shift-management {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 14px 0 20px;
  padding: 16px 20px;
  border: 1px solid rgba(236, 0, 179, 0.72);
  border-radius: 18px;
  background: linear-gradient(110deg, rgba(37, 2, 67, 0.72), rgba(93, 4, 101, 0.44));
  box-shadow: 0 12px 28px rgba(29, 0, 45, 0.2);
}

.shift-management-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.shift-management-info > span {
  color: #f28ce0 !important;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.shift-management-info > strong {
  font-size: 20px;
  color: #ffffff !important;
}

.shift-management-info > small {
  color: rgba(255, 255, 255, 0.7) !important;
}

.shift-management-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.shift-history-panel:empty { display: none; }

.shift-history-panel {
  margin: -6px 0 20px;
  padding: 14px 18px;
  border: 1px solid rgba(236, 0, 179, 0.48);
  border-radius: 16px;
  background: rgba(22, 1, 42, 0.42);
}

.shift-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 11px;
}

.shift-history-list {
  display: grid;
  gap: 7px;
}

.shift-history-list article {
  display: grid;
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(95px, 0.65fr));
  align-items: center;
  gap: 12px;
  padding: 9px 11px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
}

.shift-history-list article > div {
  display: flex;
  flex-direction: column;
}

.shift-history-list article small { color: var(--muted) !important; }

@media (max-width: 760px) {
  .shift-management { align-items: stretch; flex-direction: column; }
  .shift-management-actions { justify-content: stretch; }
  .shift-management-actions button { flex: 1; }
  .shift-history-list article { grid-template-columns: 1fr 1fr; }
}

.pairing-slot-independent {
  padding: 11px 12px;
  border-radius: 13px;
  font-weight: 800;
}

.pairing-slot-call-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.pairing-slot-call-actions button {
  min-width: 0;
  padding: 10px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 800;
}

.pairing-slot-stop { background: #6b3c9d; }
.pairing-slot-hangup { background: #a52162; }

.pairing-slot-disconnect {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(165, 33, 98, 0.42);
  border: 1px solid rgba(255, 92, 145, 0.55);
  color: #fff;
  font-weight: 800;
}

.pairing-slot-disconnect:hover {
  background: rgba(201, 33, 112, 0.68);
}

.pairing-slot-speaker {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
}

.pairing-slot-speaker.is-on {
  outline: 2px solid #73ffd0;
  outline-offset: 2px;
}

.contact-direct-cell {
  text-align: center;
}

.contact-direct-cell .wa-action-btn {
  width: 46px;
  height: 46px;
  min-width: 46px;
  padding: 9px;
  border-radius: 50%;
  background: #25d366 !important;
  border-color: #70efa0 !important;
  display: inline-grid;
  place-items: center;
  box-shadow: 0 7px 18px rgba(37, 211, 102, 0.24);
}

.contact-direct-cell .wa-action-btn:hover {
  background: #20bd5a !important;
  box-shadow: 0 9px 22px rgba(37, 211, 102, 0.38);
}

.contact-direct-cell .wa-action-btn svg {
  width: 27px;
  height: 27px;
  fill: #ffffff;
}

.pairing-slot-delete {
  margin-top: auto;
  border: 1px solid rgba(255, 92, 170, 0.55);
  background: rgba(91, 10, 73, 0.55);
  color: #fff;
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.pairing-slot-delete:hover {
  background: rgba(201, 18, 129, 0.72);
}

.pairing-slot-qr-error {
  width: min(210px, 82%);
  aspect-ratio: 1;
  border: 1px dashed rgba(255, 255, 255, 0.45);
  border-radius: 18px;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  color: rgba(255, 255, 255, 0.82);
}

.qr-general-call-controls {
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 24px auto 0;
  background: transparent;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
}

.assigned-lists-panel {
  display: grid;
  gap: 22px;
  margin-top: 22px;
}

.assigned-lists-empty,
.assigned-list-card {
  border: 1px solid rgba(236, 0, 179, 0.38);
  border-radius: 22px;
  background: rgba(34, 2, 59, 0.58);
  backdrop-filter: blur(8px);
}

.assigned-lists-empty {
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, 0.72);
}

.assigned-list-card {
  padding: 22px;
  overflow: hidden;
}

.assigned-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.assigned-list-head span {
  display: block;
  color: rgba(255, 255, 255, 0.62) !important;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.assigned-list-head h3 {
  margin: 4px 0 0;
  font-size: 24px;
}

.assigned-list-head > strong,
.assigned-list-group h4 span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(154, 53, 220, 0.38);
  border: 1px solid rgba(224, 111, 255, 0.32);
}

.assigned-list-group + .assigned-list-group {
  margin-top: 18px;
}

.assigned-list-group h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}

.assigned-list-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
}

.assigned-list-table-wrap table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.assigned-list-table-wrap th,
.assigned-list-table-wrap td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.assigned-list-group.called .assigned-list-table-wrap table {
  table-layout: fixed;
  min-width: 760px;
}

.assigned-list-group.called th:nth-child(1) { width: 7%; }
.assigned-list-group.called th:nth-child(2) { width: 28%; }
.assigned-list-group.called th:nth-child(3) { width: 18%; }
.assigned-list-group.called th:nth-child(4) { width: 13%; }
.assigned-list-group.called th:nth-child(5) { width: 14%; }
.assigned-list-group.called th:nth-child(6) { width: 20%; }

.contact-action-buttons {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.contact-action-buttons .wa-action-btn,
.contact-action-buttons .call-action-btn,
.contact-direct-cell .wa-action-btn,
.contact-direct-cell .call-action-btn {
  width: auto;
  height: 42px;
  min-width: 116px;
  padding: 0 14px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .02em;
}

.contact-action-buttons .wa-action-btn,
.contact-direct-cell .wa-action-btn {
  background: linear-gradient(135deg, #16bd68, #23dc79) !important;
  border-color: #70efa0 !important;
  color: #ffffff !important;
}

.contact-action-buttons .wa-action-btn svg,
.contact-direct-cell .wa-action-btn svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

.contact-action-buttons .call-action-btn,
.contact-direct-cell .call-action-btn {
  background: linear-gradient(135deg, #210035, #510071) !important;
  border: none !important;
  box-shadow: 0 7px 20px rgba(255, 0, 191, .28), inset 0 0 14px rgba(137, 0, 190, .32) !important;
  color: #ff20c6 !important;
  line-height: 1;
}

.contact-action-buttons .call-action-btn svg,
.contact-direct-cell .call-action-btn svg {
  width: 21px;
  height: 21px;
  display: block;
  color: #ff28c8;
  fill: #ff28c8;
  filter: drop-shadow(0 0 5px rgba(255, 40, 200, .72));
}

.contact-action-buttons .call-action-btn:not(:disabled):hover,
.contact-direct-cell .call-action-btn:not(:disabled):hover {
  background: linear-gradient(135deg, #30004c, #6c0092) !important;
  color: #ff3bd0 !important;
  filter: brightness(1.12);
  box-shadow: 0 9px 24px rgba(255, 20, 202, .46), inset 0 0 16px rgba(166, 0, 220, .38) !important;
}

.contact-action-buttons .wa-action-btn:hover,
.contact-action-buttons .call-action-btn:hover {
  transform: translateY(-1px) scale(1.035);
}

.pending-contact-phone {
  display: inline-grid;
  grid-template-columns: 10ch 42px;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.pending-contact-phone > span {
  display: block;
  width: 10ch;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

.pending-contact-phone img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 5px 9px rgba(237, 0, 181, 0.24));
}

#contactsBody td {
  padding-top: 17px;
  padding-bottom: 17px;
}

#contactsBody td:first-child {
  padding-right: 34px;
}

#contactsBody td:nth-child(2) {
  padding-left: 34px;
}

.assigned-list-table-wrap th {
  background: rgba(126, 17, 148, 0.42);
  font-size: 12px;
  text-transform: uppercase;
}

.assigned-list-table-wrap tbody tr:last-child td {
  border-bottom: 0;
}

.assigned-list-none {
  padding: 18px !important;
  text-align: center !important;
  color: rgba(255, 255, 255, 0.62) !important;
}

.answered-badge {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 800;
}

.answered-badge.yes {
  background: rgba(28, 190, 126, 0.22);
  color: #83f3c4 !important;
  border: 1px solid rgba(44, 225, 165, 0.38);
}

.answered-badge.no {
  background: rgba(221, 43, 112, 0.19);
  color: #ff9cbd !important;
  border: 1px solid rgba(255, 92, 145, 0.34);
}

@media (max-width: 700px) {
  .assigned-list-head { align-items: flex-start; flex-direction: column; }
  .assigned-list-card { padding: 16px; }
}

.qr-general-call-controls .general-call-heading {
  align-items: center;
}

.qr-general-call-controls .campaign-actions {
  justify-content: center;
}

@media (max-width: 980px) {
  .pairing-slots-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .pairing-slots-head { align-items: stretch; flex-direction: column; }
  .pairing-slots-grid { grid-template-columns: 1fr; }
  .pairing-slot-card { min-height: 320px; }
}

/* Panel operativo: teléfonos en fila y llamada general debajo. */
.campaign-panel-head {
  align-items: center;
  margin-bottom: 18px;
}

.campaign-panel-head .section-title {
  font-size: 20px;
  letter-spacing: 0;
  text-transform: none;
}

.workers-board,
#workersList.workers-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
  width: 100%;
  margin-bottom: 22px;
}

.workers-board .worker-card {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(37, 3, 66, 0.56), rgba(78, 4, 85, 0.42)) !important;
  border: 1px solid rgba(239, 24, 186, 0.40) !important;
}

.workers-board .worker-card-head {
  align-items: flex-start;
}

.workers-board .worker-card-head strong {
  font-size: 17px;
}

.workers-board .worker-state {
  min-width: 88px;
  text-align: center;
  background: rgba(10, 1, 26, 0.55);
  border: 1px solid rgba(255,255,255,0.10);
}

.workers-board .worker-contact,
.workers-board .worker-empty {
  flex: 1;
  justify-content: center;
}

.workers-board .worker-contact strong {
  font-size: 20px;
}

.workers-board .worker-contact span {
  font-size: 15px;
}

.workers-board .worker-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.workers-board .worker-actions .worker-disconnect-btn {
  grid-column: 1 / -1;
  background: rgba(196, 23, 104, 0.28);
  border: 1px solid rgba(255, 124, 184, 0.32);
  box-shadow: none;
}

.general-call-controls {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin: 4px 0 22px;
  padding: 18px 20px;
  border: 1px solid rgba(231, 0, 177, 0.38);
  border-radius: 18px;
  background: rgba(28, 2, 52, 0.34);
}

.general-call-heading {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 430px;
}

.general-call-heading strong {
  font-size: 20px;
}

.general-call-heading span {
  color: var(--muted) !important;
  font-size: 13px;
}

.general-call-controls .campaign-actions {
  justify-content: flex-end;
  align-items: end;
}

.general-call-controls #campaignStartBtn {
  min-width: 210px;
}

.general-call-controls.qr-general-call-controls {
  width: 100%;
  min-height: 180px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 24px 0 0;
}

.general-call-controls.qr-general-call-controls .general-call-heading {
  align-items: center;
  max-width: 620px;
}

.general-call-controls.qr-general-call-controls .campaign-actions {
  width: 100%;
  justify-content: center;
  align-items: center;
}

.assigned-list-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 9px;
}

.assigned-list-status {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(154, 53, 220, 0.38);
  border: 1px solid rgba(224, 111, 255, 0.32);
}

.assigned-list-status.finished {
  color: #83f3c4 !important;
  background: rgba(28, 190, 126, 0.18);
  border-color: rgba(44, 225, 165, 0.38);
}

.assigned-list-download,
.assigned-list-delete {
  padding: 9px 12px;
  border-radius: 11px;
  font-size: 12px;
  font-weight: 800;
}

.assigned-list-download { background: #6c2b9b; }
.assigned-list-delete { background: #a52162; }

/* Identidad visual: acciones magenta con etiquetas destacadas. */
button,
.file-label,
#apkDlBtn {
  background: linear-gradient(135deg, #ed00b5, #a900d6) !important;
  border-color: rgba(255, 112, 220, 0.78) !important;
  color: #ffffff !important;
  text-transform: uppercase;
  letter-spacing: 0.035em;
  font-weight: 800;
  transition: transform 0.18s ease, box-shadow 0.22s ease, filter 0.18s ease, background 0.22s ease;
  transform-origin: center;
}

button:not(:disabled):hover,
.file-label:hover,
#apkDlBtn:hover {
  background: linear-gradient(135deg, #ff18c4, #c217ed) !important;
  transform: translateY(-2px) scale(1.045);
  box-shadow: 0 10px 26px rgba(237, 0, 181, 0.42), 0 0 16px rgba(255, 42, 205, 0.2);
  filter: saturate(1.12) brightness(1.08);
}

button:not(:disabled):active,
.file-label:active,
#apkDlBtn:active {
  transform: translateY(0) scale(0.985);
}

button:disabled {
  background: rgba(126, 44, 133, 0.58) !important;
  border-color: rgba(221, 148, 230, 0.28) !important;
  color: rgba(255, 255, 255, 0.62) !important;
}

.general-call-controls.qr-general-call-controls {
  border: 0 !important;
  box-shadow: none !important;
}

/* Borde visual uniforme para los cuadros operativos. */
.qr-block,
.pairing-slot-card,
.general-call-controls,
.assigned-list-card,
.assigned-list-group,
.campaign-panel,
.campaign-card,
.worker-card,
.campaign-report-panel,
.contacts-import-panel,
.contacts-table-wrap {
  border: 1px solid rgba(236, 0, 179, 0.82) !important;
  box-shadow: 0 0 0 1px rgba(236, 0, 179, 0.08), 0 12px 28px rgba(43, 0, 57, 0.18);
}

.campaign-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .general-call-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .general-call-controls .campaign-actions {
    justify-content: flex-start;
  }

  .campaign-summary-grid {
    grid-template-columns: 1fr;
  }

  .assigned-list-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

.contact-status-legend-title {
  color: var(--text2);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.contact-status-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 12px;
}

#contactInlineRow {
  display: none;
}

.floating-add-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 58px;
  height: 58px;
  min-height: 58px;
  padding: 0;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
  z-index: 1300;
  box-shadow: 0 10px 30px rgba(192, 38, 211, 0.45);
}

.reminder-float-container {
  position: fixed;
  right: 24px;
  bottom: 96px;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  z-index: 1290;
}

.reminder-float-card {
  border: 1px solid rgba(245, 158, 11, 0.5);
  background: rgba(48, 20, 5, 0.92);
  color: #fde68a;
  border-radius: 14px;
  padding: 12px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.reminder-float-card.is-due {
  border-color: rgba(251, 113, 133, 0.65);
  background: rgba(62, 9, 24, 0.95);
  color: #fecdd3;
}

.reminder-float-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 3px;
}

.reminder-float-meta {
  font-size: 12px;
  color: #f9a8d4;
  margin-bottom: 8px;
}

.reminder-float-actions {
  display: flex;
  gap: 8px;
}

.reminder-float-actions button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

/* ── EDIT MODAL ─────────────────────────────────────── */
.edit-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 16px;
  z-index: 1200;
}

.edit-card {
  width: min(480px, 100%);
  position: relative;
  background: var(--card);
  border: 1px solid var(--border-bright);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.edit-card h3 {
  font-size: 20px;
  margin-bottom: 14px;
}

.whatsapp-card {
  width: min(520px, 100%);
}

.quotation-card {
  width: min(1040px, 100%);
  max-height: 92vh;
  overflow: auto;
}

.quotation-form-grid {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px 12px;
}

.quotation-form-grid label {
  margin-top: 2px;
}

.quotation-table-wrap {
  margin-top: 12px;
}

.quotation-totals {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  background: rgba(120, 0, 180, 0.05);
  display: grid;
  gap: 8px;
}

.quotation-total-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.quotation-total-line.grand {
  border-top: 1px solid var(--border);
  padding-top: 8px;
  font-size: 16px;
}

.quotation-igv-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text2);
}

.quotation-igv-label input {
  min-width: auto;
  min-height: auto;
}

.quote-item-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.quote-item-actions button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.quotation-preview-modal {
  z-index: 1400;
}

.quotation-preview-card {
  width: min(1260px, 100%);
  height: 94vh;
  max-height: 94vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  overflow: hidden;
}

.quotation-preview-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quotation-send-feedback {
  min-height: 22px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 12px;
  color: var(--muted);
}

.quotation-send-feedback.is-sending {
  border-color: rgba(59, 130, 246, 0.45);
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
}

.quotation-send-feedback.is-ok {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
  background: rgba(34, 197, 94, 0.14);
}

.quotation-send-feedback.is-error {
  border-color: rgba(251, 113, 133, 0.5);
  color: #fda4af;
  background: rgba(124, 58, 237, 0.16);
}

.quotation-preview-frame {
  width: 100%;
  height: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f5f5f5;
}

.whatsapp-phone {
  font-family: monospace;
  font-size: 13px;
  margin-bottom: 14px;
}

.whatsapp-panel {
  display: grid;
  gap: 12px;
}

.wa-connect-ok {
  border: 1px solid rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.12);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.wa-connect-ok.is-offline {
  border-color: rgba(251, 113, 133, 0.5);
  background: rgba(124, 58, 237, 0.12);
}

.wa-connect-ok strong {
  color: #86efac;
  font-size: 14px;
}

.wa-connect-ok.is-offline strong {
  color: #fda4af;
}

.wa-connect-ok small {
  color: #d1fae5;
  font-family: monospace;
}

.wa-connect-ok.is-offline small {
  color: #ffe4e6;
}

.whatsapp-templates {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.whatsapp-template-create-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.whatsapp-template-create-row input {
  min-width: 0;
}

.whatsapp-template-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: center;
}

.whatsapp-template-btn {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(120, 0, 180, 0.12);
  color: var(--text2);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.3;
  text-align: left;
}

.whatsapp-template-remove-btn {
  min-height: 36px;
  width: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.14);
  color: #fda4af;
  box-shadow: none;
}

.whatsapp-template-btn:hover {
  background: rgba(192, 38, 211, 0.18);
  border-color: var(--accent);
}

.whatsapp-template-remove-btn:hover {
  background: rgba(124, 58, 237, 0.24);
  border-color: rgba(124, 58, 237, 0.7);
}

.whatsapp-drop-zone {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  background: rgba(120, 0, 180, 0.04);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.whatsapp-drop-zone:hover {
  border-color: var(--accent);
  background: rgba(192, 38, 211, 0.08);
  box-shadow: 0 0 15px var(--accent-glow);
}

.whatsapp-drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(192, 38, 211, 0.15);
  transform: scale(1.02);
}

.drop-zone-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.drop-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 5px var(--accent-glow));
}

.drop-text {
  font-size: 13px;
  color: var(--text2);
}

#whatsappQrImg {
  width: 220px;
  height: 220px;
  background: #ffffff;
  border-radius: 12px;
  padding: 8px;
  justify-self: center;
}

.edit-form {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.edit-form label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.edit-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  min-height: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(120, 0, 180, 0.12);
  box-shadow: none;
  padding: 0;
}

.pagination {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.pagination button {
  min-height: 32px;
  font-size: 12px;
  padding: 0 10px;
}

.pagination button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* ── CALL MODAL ──────────────────────────────────────── */
.call-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 0, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.call-card {
  width: min(500px, 100%);
  border: 1px solid var(--border-bright);
  border-radius: 32px;
  background: rgba(20, 0, 35, 0.6);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 36px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 30px 100px rgba(0, 0, 0, 0.6),
    0 0 40px var(--accent-glow);
}

.call-pulse-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: grid;
  place-items: center;
  font-size: 36px;
  margin: 0 auto 20px;
  position: relative;
  box-shadow: 0 0 30px var(--accent-glow);
  animation: pulse-ring 2.2s ease-in-out infinite;
}

.call-pulse-ring img {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  object-fit: cover;
}

@keyframes pulse-ring {

  0%,
  100% {
    box-shadow: 0 0 20px var(--accent-glow);
  }

  50% {
    box-shadow: 0 0 50px rgba(192, 38, 211, 0.5), 0 0 80px rgba(124, 58, 237, 0.3);
  }
}

.call-card-inner {
  text-align: center;
}

.call-kicker {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #c084fc;
  margin-bottom: 6px;
}

.call-kicker.state-dialing,
.call-kicker.state-ringing {
  color: var(--yellow);
}

.call-kicker.state-in_call {
  color: var(--green);
}

.call-kicker.state-ended {
  color: var(--muted);
}

.call-kicker.state-failed {
  color: #f87171;
}

/* New Call Pulsing Behavior */
.call-pulse-ring.is-calling {
  animation: call-pulse-yellow 1.4s infinite;
  border-color: rgba(245, 158, 11, 0.4);
}

.call-pulse-ring.is-in-call {
  animation: call-pulse-green 1.4s infinite;
  border-color: rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

@keyframes call-pulse-yellow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 15px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

@keyframes call-pulse-green {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Modal transitions and state-based styling */
.call-modal.is-active-call .call-card {
  border-color: #10b981;
  box-shadow: 0 0 60px rgba(16, 185, 129, 0.35);
  background: rgba(6, 78, 59, 0.65); /* Dark green tint */
}

/* Kicker states inside modal */
.call-modal.is-ringing .call-card {
  border-color: #f59e0b;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.25);
}

.call-card h3 {
  font-size: clamp(24px, 3.6vw, 32px);
  font-weight: 700;
  margin: 0 0 4px;
}

.call-card .call-number {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 4px;
}

.call-card .call-note {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.call-meta {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.call-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.call-controls button {
  min-width: 88px;
  max-width: 180px;
}

.call-controls-main {
  margin-top: 6px;
}

.call-controls-main button {
  min-width: 130px;
  width: 100%;
}

.call-controls .icon-btn.secondary {
  background: rgba(120, 0, 180, 0.16);
  border: 1px solid rgba(168, 85, 247, 0.35);
  color: #dcc2ff;
}

/* ── BADGE ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid rgba(100, 0, 150, 0.4);
  background: rgba(120, 0, 180, 0.1);
  color: var(--muted);
}

.badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.badge.state-idle,
.badge.state-ended {
  color: var(--muted);
}

.badge.state-dialing,
.badge.state-ringing {
  color: var(--yellow);
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(245, 158, 11, 0.08);
  animation: blink-badge 1.2s ease-in-out infinite;
}

.badge.state-in_call {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.badge.state-failed {
  color: #f87171;
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.14);
}

.badge.ack-pending {
  color: var(--yellow);
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.1);
}

.badge.ack-ok {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.1);
}

.badge.ack-fail {
  color: #f87171;
  border-color: rgba(124, 58, 237, 0.5);
  background: rgba(124, 58, 237, 0.14);
}

@keyframes blink-badge {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.55;
  }
}

/* ── MIC INDICATOR ──────────────────────────────────── */
.mic-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mic-indicator.on {
  color: var(--green);
  border-color: rgba(16, 185, 129, 0.4);
}

.mic-indicator.muted {
  color: var(--danger);
  border-color: rgba(124, 58, 237, 0.4);
}

/* ── SECTION DIVIDER ─────────────────────────────────── */
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin: 18px 0 10px;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.contacts-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.contacts-title {
  flex: 1;
  margin: 0;
}

.called-counter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(245, 158, 11, 0.42);
  background: rgba(245, 158, 11, 0.14);
  color: #fef3c7;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.called-counter strong {
  font-size: 14px;
}

/* ── MUTED TEXT ─────────────────────────────────────── */
.muted {
  color: var(--muted);
}

/* ── PHONE PAGE SPECIFIC ────────────────────────────── */
.phone-layout {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
}

.phone-card {
  width: min(380px, 100%);
  background: var(--card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 40px 24px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.phone-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  display: grid;
  place-items: center;
  font-size: 32px;
  margin: 0 auto 20px;
  box-shadow: 0 0 30px var(--accent-glow);
}

.phone-card h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #e879f9, #a78bfa);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.phone-status-box {
  background: rgba(120, 0, 180, 0.08);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: var(--text2);
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  line-height: 1.4;
}

.phone-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.perm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0;
}

.perm-item {
  background: rgba(120, 0, 180, 0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  text-align: left;
  font-size: 12px;
}

.perm-item .perm-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.perm-item .perm-val {
  font-weight: 600;
  font-size: 13px;
}

.perm-val.granted {
  color: var(--green);
}

.perm-val.denied {
  color: var(--danger);
}

.perm-val.pending {
  color: var(--yellow);
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 1024px) {
  .layout {
    padding: 20px 12px;
  }

  .panel {
    width: 100%;
    padding: 22px;
  }
}

@media (max-width: 640px) {
  .campaign-panel-head {
    flex-direction: column;
  }

  .campaign-grid {
    grid-template-columns: 1fr;
  }

  .campaign-card-wide {
    grid-column: auto;
  }

  .qr-block {
    grid-template-columns: 1fr;
  }

  .qr-block.is-linked .pairing-data {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .call-card {
    padding: 22px 18px;
  }

  .perm-grid {
    grid-template-columns: 1fr;
  }

  .apk-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .contacts-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .linked-banner {
    align-items: flex-start;
  }
}

/* ── APK BAR ─────────────────────────────────────────── */
.apk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

.apk-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.apk-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.apk-icon-img {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px;
  min-height: 22px;
  max-width: 22px;
  max-height: 22px;
  border-radius: 0;
  object-fit: cover;
  display: block;
  flex: 0 0 22px;
  box-shadow: none;
  background: transparent;
}

.apk-info strong {
  display: block;
  font-size: 14px;
  color: var(--text);
}

.apk-info small {
  font-size: 12px;
  color: var(--muted);
}

.apk-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.apk-version-select {
  min-height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(120, 0, 180, 0.12);
  color: var(--text2);
  padding: 0 10px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.btn-apk-dl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(192, 38, 211, 0.3);
  transition: filter 0.2s, box-shadow 0.2s;
}

.btn-apk-dl:hover {
  filter: brightness(1.12);
  box-shadow: 0 4px 22px rgba(192, 38, 211, 0.5);
}

/* ── INSTALL GUIDE ───────────────────────────────────── */
.install-guide {
  background: rgba(120, 0, 180, 0.06);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text2);
  line-height: 1.6;
}

.install-guide ol {
  margin: 0;
  padding-left: 18px;
}

.install-guide li {
  margin-bottom: 4px;
}

.install-guide strong {
  color: #c084fc;
}

/* ── IMPORT PANEL ────────────────────────────────────── */
.import-panel {
  background: rgba(120, 0, 180, 0.05);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin: 10px 0 16px;
}

.import-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.import-tab {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  min-height: 34px;
  border-radius: 8px;
  background: rgba(120, 0, 180, 0.08);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: none;
}

.import-tab.active,
.import-tab:hover {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(192, 38, 211, 0.3);
}

.import-body {
  min-height: 60px;
}

/* ── FILE LABEL ──────────────────────────────────────── */
.file-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(192, 38, 211, 0.25);
  transition: filter 0.2s, box-shadow 0.2s;
}

.file-label:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 20px rgba(192, 38, 211, 0.4);
}

/* ── PREMIUM DIALPAD ───────────────────────────────────── */
.premium-btn {
  background: linear-gradient(135deg, #f472b6, #db2777);
  box-shadow: 0 4px 15px rgba(219, 39, 119, 0.35);
  font-weight: 700 !important;
}
.premium-btn:hover {
  box-shadow: 0 6px 22px rgba(219, 39, 119, 0.55);
}

/* Concurrent phone workers */
.campaign-list-picker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.campaign-list-picker select {
  min-height: 38px;
  min-width: 150px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface, #fff);
  color: var(--text);
  padding: 0 10px;
  font: inherit;
}

#workersList {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.worker-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 5px 18px rgba(31, 16, 61, 0.06);
}

.worker-card.is-busy { border-color: rgba(124, 58, 237, .5); }
.worker-card.is-ready { border-color: rgba(16, 185, 129, .35); }
.worker-card.is-paused { border-color: rgba(245, 158, 11, .45); background: rgba(245, 158, 11, .05); }
.worker-card.is-offline { opacity: .62; }

.worker-card-head,
.worker-actions,
.worker-contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.worker-card-head > div,
.worker-contact { flex-direction: column; align-items: flex-start; }
.worker-card small,
.worker-contact span,
.worker-empty { color: var(--muted); font-size: 12px; }
.worker-state { font-size: 11px; font-weight: 700; padding: 5px 8px; border-radius: 999px; background: rgba(124, 58, 237, .1); }
.worker-contact { margin-top: 12px; }
.worker-duration { margin: 8px 0; font: 700 18px/1 monospace; }
.worker-empty { min-height: 48px; display: flex; align-items: center; }
.worker-actions { margin-top: 10px; }
.worker-actions button { min-height: 32px; padding: 0 10px; font-size: 12px; flex: 1; }

.contact-disposition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.contact-disposition-actions button {
  min-height: 27px;
  padding: 0 8px;
  font-size: 10px;
}

.list-name-card {
  width: min(440px, calc(100vw - 32px));
}

.list-name-error {
  min-height: 20px;
  margin: 6px 0 0;
  color: #b42318;
  font-size: 13px;
}

.confirm-message {
  margin-top: 12px;
  color: var(--text2);
  line-height: 1.55;
  white-space: pre-line;
}

/* ── CALL HISTORY ────────────────────────────────────── */
.history-card {
  width: min(500px, 90vw);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.history-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(180, 0, 230, 0.1);
  padding: 14px 18px;
  border-radius: 16px;
  transition: all 0.2s;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.history-phone {
  font-family: monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.history-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 8px;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.history-call-btn {
  padding: 0 14px;
  height: 34px;
  min-height: 34px;
  font-size: 12px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
}

/* ── CONTACT TABS ─────────────────────────────────────── */
.contacts-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}
.contacts-tabs::-webkit-scrollbar { display: none; }

.tab-item {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 16px;
  border-radius: 12px;
  color: #94A3B8;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transition: all 0.2s ease;
  user-select: none;
}

.tab-item:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.tab-item.active {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.delete-tab-btn {
  background: rgba(0,0,0,0.2);
  border: none;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.delete-tab-btn:hover {
  background: rgba(244, 63, 94, 0.8);
}

.add-tab-btn {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #6366F1;
  padding: 8px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
  transition: all 0.2s;
}

.add-tab-btn:hover {
  border-color: #6366F1;
  background: rgba(99, 102, 241, 0.05);
}

/* Audio active states */
button.btn-audio-active {
  background: linear-gradient(135deg, #059669, #10b981) !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.45) !important;
  color: white !important;
  border-color: transparent !important;
}

.mic-indicator.is-active {
  color: #10b981 !important;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

/* ── CLEAN PROFESSIONAL THEME OVERRIDES ───────────────────────────── */
:root {
  --bg: #f4f4f6;
  --card: rgba(255, 255, 255, 0.94);
  --card2: rgba(250, 250, 252, 0.92);
  --border: rgba(15, 23, 42, 0.1);
  --border-bright: rgba(124, 58, 237, 0.22);
  --accent: #7C3AED;
  --accent2: #4F46E5;
  --accent-glow: rgba(124, 58, 237, 0.18);
  --text: #101010;
  --text2: #2f2f39;
  --muted: #6c6c76;
  --danger: #7C3AED;
  --success: #149a64;
  --yellow: #d97706;
  --green: #149a64;
}

body {
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124, 58, 237, 0.09), transparent 24%),
    radial-gradient(circle at bottom right, rgba(17, 17, 17, 0.06), transparent 24%),
    linear-gradient(180deg, #f9f9fb 0%, #efeff2 100%);
}

.layout {
  padding: 28px 18px;
}

.panel,
.edit-card,
.call-card,
.phone-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 249, 251, 0.93));
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow:
    0 20px 60px rgba(15, 23, 42, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.app-header {
  align-items: center;
  gap: 18px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.app-logo {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(145deg, #111111, #7C3AED);
  box-shadow: 0 18px 36px rgba(124, 58, 237, 0.2);
  font-size: 0;
}

.app-logo span {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #ffffff;
}

.app-title {
  flex: 1;
}

.app-title h1,
.phone-card h2 {
  background: linear-gradient(90deg, #111111 0%, #7C3AED 92%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-title p,
.muted,
th,
.section-title,
.install-guide,
.apk-info small {
  color: var(--muted);
}

.app-header-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.header-chip-accent {
  border-color: rgba(124, 58, 237, 0.18);
  background: rgba(124, 58, 237, 0.08);
  color: #7C3AED;
}

.session-bar,
.apk-bar,
.campaign-panel,
.status-pill,
.qr-block,
.linked-banner,
.import-panel,
.contact-status-legend,
.phone-status-box,
.perm-item,
.history-item,
.campaign-card,
.campaign-counter,
.worker-chip,
.callback-item,
.campaign-active-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 248, 250, 0.9));
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.status-pill {
  border-style: solid;
}

.status-dot {
  background: #9ca3af;
}

.status-dot.active {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(20, 154, 100, 0.12);
}

.linked-banner {
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(124, 58, 237, 0.12);
  background:
    radial-gradient(circle at right, rgba(124, 58, 237, 0.1), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(251, 247, 249, 0.96));
}

.linked-banner-copy {
  display: grid;
  gap: 6px;
}

.linked-banner-label {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7C3AED;
}

.linked-banner strong {
  color: var(--text);
  font-size: 20px;
}

.linked-device-text {
  display: block;
  font-size: 13px;
  margin-top: 0;
  color: var(--muted);
}

.linked-dialer-card {
  width: min(280px, 100%);
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(160deg, #101010, #27272f 60%, #7C3AED 155%);
  color: #ffffff;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.2);
}

.linked-dialer-top,
.linked-dialer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.linked-dialer-top {
  margin-bottom: 18px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.9;
}

.linked-dialer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #32d296;
  box-shadow: 0 0 0 6px rgba(50, 210, 150, 0.12);
}

.linked-dialer-title {
  margin-left: auto;
}

.linked-dialer-number {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-bottom: 22px;
}

.dialer-action {
  display: inline-flex;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
}

.dialer-action-muted {
  background: rgba(255, 255, 255, 0.08);
}

.dialer-action-accent {
  background: rgba(124, 58, 237, 0.36);
}

.dialer-action-success {
  background: rgba(20, 154, 100, 0.36);
}

.qr-block {
  align-items: stretch;
  padding: 22px;
}

.qr-copy {
  display: grid;
  align-content: start;
}

.qr-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #7C3AED;
  margin-bottom: 10px;
}

.qr-title {
  font-size: 24px;
  line-height: 1.1;
  margin-bottom: 8px;
}

.qr-description {
  max-width: 28ch;
  margin-bottom: 16px;
}

#pairQr {
  border-radius: 18px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

input,
textarea,
.apk-version-select {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.1);
}

input:focus,
textarea:focus,
.apk-version-select:focus {
  border-color: rgba(124, 58, 237, 0.38);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
}

button,
.btn-apk-dl,
.file-label,
.import-tab.active,
.import-tab:hover,
.tab-item.active {
  background: linear-gradient(135deg, #111111, #7C3AED);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 12px 22px rgba(124, 58, 237, 0.18);
}

button.secondary,
button.danger-soft,
.add-tab-btn,
.tab-item,
.history-call-btn,
.call-controls .icon-btn.secondary {
  background: rgba(255, 255, 255, 0.88);
  color: var(--text2);
  border: 1px solid rgba(15, 23, 42, 0.09);
  box-shadow: none;
}

button.secondary:hover,
.add-tab-btn:hover,
.tab-item:hover,
.history-call-btn:hover {
  border-color: rgba(124, 58, 237, 0.22);
  background: rgba(255, 240, 246, 0.86);
}

.premium-btn {
  background: linear-gradient(135deg, #111111, #7C3AED);
}

.called-counter,
.call-count-chip {
  border-color: rgba(124, 58, 237, 0.18);
  background: rgba(124, 58, 237, 0.08);
  color: #7C3AED;
}

.duration-chip {
  color: var(--success);
  border-color: rgba(20, 154, 100, 0.22);
  background: rgba(20, 154, 100, 0.08);
}

/* Las listas deben conservar contraste sobre el fondo audiovisual oscuro. */
.contacts-tabs .tab-item,
.contacts-tabs .tab-item.active {
  background: linear-gradient(145deg, rgba(24, 2, 45, 0.96), rgba(67, 4, 78, 0.94)) !important;
  color: #ffffff !important;
  border: 1px solid rgba(236, 0, 179, 0.62) !important;
  box-shadow: 0 7px 18px rgba(10, 0, 28, 0.28) !important;
}

.contacts-tabs .tab-item:hover,
.contacts-tabs .tab-item.active:hover {
  background: linear-gradient(145deg, rgba(48, 4, 72, 0.98), rgba(102, 5, 104, 0.96)) !important;
  border-color: rgba(255, 78, 205, 0.9) !important;
}

.contacts-tabs .tab-item > span {
  color: #ffffff !important;
  font-weight: 800;
  letter-spacing: 0.025em;
}

thead tr,
tbody tr:hover {
  background: rgba(124, 58, 237, 0.04);
}

th,
.contact-status-legend-title,
.section-title {
  color: var(--muted);
}

.campaign-metric,
.worker-chip strong,
.callback-item strong,
.campaign-active-card strong,
.history-phone {
  color: var(--text);
}

.badge,
.campaign-status-chip {
  background: rgba(17, 17, 17, 0.05);
  border-color: rgba(17, 17, 17, 0.08);
}

.call-modal {
  background: rgba(10, 10, 12, 0.48);
}

.call-card {
  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 246, 248, 0.96));
  border-color: rgba(124, 58, 237, 0.18);
  color: var(--text);
}

.call-pulse-ring {
  width: 92px;
  height: 92px;
  border-radius: 28px;
  background: linear-gradient(145deg, #111111, #7C3AED);
  box-shadow: 0 18px 36px rgba(124, 58, 237, 0.18);
}

.call-kicker {
  color: #7C3AED;
}

.call-card .call-number,
.call-card .call-note {
  color: var(--muted);
}

.phone-card {
  border-radius: 30px;
}

.phone-icon {
  border-radius: 22px;
  background: linear-gradient(145deg, #111111, #7C3AED);
}

@media (max-width: 768px) {
  .app-header {
    align-items: flex-start;
  }

  .app-header-meta,
  .linked-banner {
    width: 100%;
  }

  .linked-banner {
    flex-direction: column;
    align-items: stretch;
  }
}
.campaign-report-card {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(31, 15, 55, 0.86), rgba(7, 3, 24, 0.9));
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.04);
  animation: report-reveal 0.45s ease both;
}

.campaign-report-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.campaign-report-head h3,
.campaign-report-head p { margin: 0; }
.campaign-report-head p { margin-top: 4px; font-size: 12px; }

.campaign-report-count {
  flex: 0 0 auto;
  padding: 7px 11px;
  border-radius: 999px;
  color: #e9d5ff;
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.32), rgba(192, 38, 211, 0.24));
  border: 1px solid rgba(192, 132, 252, 0.28);
  font-size: 12px;
  font-weight: 800;
}

.campaign-report-table-wrap {
  position: relative;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(3, 0, 20, 0.46);
  scrollbar-color: #7c3aed rgba(255, 255, 255, 0.04);
}

.campaign-report-table { min-width: 1260px; margin: 0; }
.campaign-report-table thead { position: sticky; top: 0; z-index: 2; }
.campaign-report-table th {
  white-space: nowrap;
  color: #f3e8ff;
  background: linear-gradient(180deg, #24123b, #180b2a);
  border-bottom: 1px solid rgba(192, 132, 252, 0.28);
  letter-spacing: 0.025em;
}
.campaign-report-table td {
  white-space: nowrap;
  font-size: 12px;
  border-bottom: 1px solid rgba(168, 85, 247, 0.1);
}
.campaign-report-row { animation: report-row-in 0.3s ease both; transition: background 0.2s ease; }
.campaign-report-row:nth-child(even) { background: rgba(124, 58, 237, 0.045); }
.campaign-report-row:hover { background: rgba(124, 58, 237, 0.14); }
.campaign-report-row.result-contesto,
.campaign-report-row.result-interesado { box-shadow: inset 3px 0 #22c55e; }
.campaign-report-row.result-sin_respuesta,
.campaign-report-row.result-no_contactado { box-shadow: inset 3px 0 #f43f5e; }
.campaign-report-row.result-reintentar { box-shadow: inset 3px 0 #f59e0b; }
.campaign-report-row.result-agendado,
.campaign-report-row.result-requiere_asesor { box-shadow: inset 3px 0 #38bdf8; }
.campaign-report-phone { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.campaign-report-result {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(100, 116, 139, 0.16);
  color: #cbd5e1;
  font-size: 11px;
  font-weight: 800;
  text-transform: capitalize;
}

.campaign-report-result.result-contesto,
.campaign-report-result.result-interesado { color: #86efac; background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.28); }
.campaign-report-result.result-sin_respuesta,
.campaign-report-result.result-no_contactado,
.campaign-report-result.result-no_interesado { color: #fda4af; background: rgba(244, 63, 94, 0.14); border-color: rgba(244, 63, 94, 0.28); }
.campaign-report-result.result-reintentar { color: #fde68a; background: rgba(245, 158, 11, 0.14); border-color: rgba(245, 158, 11, 0.28); }
.campaign-report-result.result-agendado,
.campaign-report-result.result-requiere_asesor { color: #7dd3fc; background: rgba(14, 165, 233, 0.14); border-color: rgba(14, 165, 233, 0.28); }
.campaign-report-empty { padding: 28px 16px; color: var(--muted); text-align: center; font-size: 13px; }

@keyframes campaign-gradient { to { background-position: 200% 0; } }
@keyframes campaign-card-pop { from { opacity: 0; transform: translateY(7px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes report-reveal { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes report-row-in { from { opacity: 0; transform: translateX(-7px); } to { opacity: 1; transform: none; } }
@keyframes worker-active-glow { 50% { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08), 0 0 22px rgba(16, 185, 129, 0.13); } }

@media (prefers-reduced-motion: reduce) {
  .campaign-panel::before,
  .campaign-counter,
  .worker-chip.is-active,
  .campaign-report-card,
  .campaign-report-row { animation: none !important; }
}

@media (max-width: 720px) {
  .campaign-report-card { padding: 13px; border-radius: 15px; }
  .campaign-report-head { align-items: flex-start; }
  .campaign-report-count { font-size: 11px; }
  .campaign-report-table-wrap { max-height: 300px; }
}

/* Tema violeta VC: sobrio, legible y basado en el morado del logotipo. */
:root {
  --bg: #4b1765;
  --card: rgba(48, 13, 68, 0.92);
  --card2: rgba(65, 22, 88, 0.82);
  --surface: #5b2478;
  --border: rgba(233, 213, 255, 0.20);
  --border-bright: rgba(233, 213, 255, 0.38);
  --accent: #a77bd4;
  --accent2: #7b4aa2;
  --accent-glow: rgba(196, 151, 232, 0.22);
  --text: #fffaff;
  --text2: #eadff0;
  --muted: #cbb8d4;
  --green: #75d5ae;
  --yellow: #e7c77b;
  --success: #75d5ae;
  --danger: #dc8ca0;
}

body {
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 12% 10%, rgba(223, 186, 247, 0.16), transparent 36%),
    radial-gradient(circle at 88% 88%, rgba(104, 53, 136, 0.34), transparent 42%),
    linear-gradient(145deg, #55206f 0%, #42135b 48%, #37104d 100%);
}

.panel {
  background: linear-gradient(155deg, rgba(57, 16, 77, 0.94), rgba(43, 11, 61, 0.94));
  border-color: rgba(239, 220, 255, 0.22);
  box-shadow: 0 24px 58px rgba(31, 7, 43, 0.42), inset 0 1px rgba(255,255,255,0.06);
}

.app-logo,
button:not(.secondary):not(.danger-soft):not(.icon-btn),
.floating-add-btn {
  background: linear-gradient(135deg, #b58adb, #8150a6);
  color: #25102f;
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 8px 20px rgba(28, 7, 39, 0.25);
}

.app-title h1 {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: #fff7ff;
}

button.secondary,
button.icon-btn,
.import-tab,
.contacts-tabs button {
  background: rgba(245, 231, 255, 0.10);
  color: #f4eafa;
  border-color: rgba(241, 220, 255, 0.24);
}

button.secondary:hover,
button.icon-btn:hover,
.import-tab:hover,
.contacts-tabs button:hover {
  background: rgba(245, 231, 255, 0.17);
  border-color: rgba(241, 220, 255, 0.38);
}

button.danger-soft {
  color: #ffdce5;
  background: rgba(190, 79, 107, 0.20);
  border-color: rgba(242, 165, 185, 0.32);
}

input,
select,
textarea {
  background: rgba(35, 8, 50, 0.68);
  color: var(--text);
  border-color: rgba(238, 215, 255, 0.23);
}

input::placeholder,
textarea::placeholder { color: #bea9c8; }

input:focus,
select:focus,
textarea:focus {
  border-color: #c59be3;
  box-shadow: 0 0 0 3px rgba(197, 155, 227, 0.15);
}

.session-bar,
.qr-block,
.campaign-panel,
.import-panel,
.worker-card,
.campaign-counter,
.campaign-report-card,
.edit-card,
.modal-card {
  background: rgba(66, 20, 88, 0.78) !important;
  border-color: rgba(235, 211, 251, 0.20);
}

.apk-bar,
.campaign-card,
#contactsSection,
.import-preview,
.quotation-card {
  background: rgba(76, 28, 98, 0.72) !important;
  border-color: rgba(235, 211, 251, 0.20) !important;
  color: var(--text2);
}

.qr-title,
.campaign-card h3,
.campaign-report-head h3,
.section-title,
.apk-info strong { color: #fff8ff; }

table { color: var(--text2); }
th {
  color: #fff8ff !important;
  background: #54206e !important;
}
td { border-color: rgba(235, 211, 251, 0.12); }
tbody tr:hover { background: rgba(232, 205, 250, 0.08); }

a { color: #e1c3f3; }
a:hover { color: #fff7ff; }

.status-pill,
.campaign-report-table-wrap {
  background: rgba(35, 8, 50, 0.48);
}

/* Variante clara solicitada: cristal lavanda sobre el morado VC. */
:root {
  --bg: #74408c;
  --card: rgba(247, 238, 251, 0.86);
  --card2: rgba(235, 217, 244, 0.82);
  --surface: #ead8f1;
  --border: rgba(68, 28, 82, 0.18);
  --border-bright: rgba(68, 28, 82, 0.30);
  --text: #211425;
  --text2: #332039;
  --muted: #604b66;
}

body {
  color: var(--text);
  background-image:
    radial-gradient(circle at 14% 8%, rgba(255, 255, 255, 0.42), transparent 34%),
    radial-gradient(circle at 86% 82%, rgba(232, 205, 244, 0.44), transparent 40%),
    linear-gradient(145deg, #925eaa 0%, #74408c 48%, #5f2d78 100%);
}

.panel {
  color: var(--text);
  background: linear-gradient(150deg, rgba(250, 244, 252, 0.88), rgba(229, 208, 239, 0.82));
  border-color: rgba(255,255,255,0.48);
  backdrop-filter: blur(28px) saturate(115%);
  -webkit-backdrop-filter: blur(28px) saturate(115%);
  box-shadow: 0 24px 55px rgba(49, 15, 61, 0.25), inset 0 1px rgba(255,255,255,0.62);
}

body .panel * { color: #211425 !important; }

.session-bar,
.qr-block,
.campaign-panel,
.import-panel,
.worker-card,
.campaign-counter,
.campaign-report-card,
.edit-card,
.modal-card,
.apk-bar,
.campaign-card,
#contactsSection,
.import-preview,
.quotation-card {
  background: rgba(255, 251, 255, 0.58) !important;
  border-color: rgba(68, 28, 82, 0.16) !important;
  box-shadow: inset 0 1px rgba(255,255,255,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.status-pill,
.campaign-report-table-wrap {
  background: rgba(226, 205, 236, 0.55);
  border-color: rgba(68, 28, 82, 0.15);
}

input,
select,
textarea {
  color: #211425 !important;
  background: rgba(255,255,255,0.68);
  border-color: rgba(68, 28, 82, 0.22);
}

input::placeholder,
textarea::placeholder { color: #6a576f !important; }

button:not(.danger-soft),
.btn-apk-dl,
.contacts-tabs button,
.import-tab {
  color: #211425 !important;
  background: linear-gradient(135deg, rgba(208, 174, 225, 0.92), rgba(184, 139, 207, 0.92));
  border-color: rgba(68, 28, 82, 0.20);
}

button.secondary,
button.icon-btn {
  color: #211425 !important;
  background: rgba(224, 201, 235, 0.76);
}

button.danger-soft {
  color: #32151c !important;
  background: rgba(226, 170, 184, 0.58);
  border-color: rgba(112, 43, 60, 0.22);
}

th {
  color: #211425 !important;
  background: rgba(207, 175, 222, 0.88) !important;
}

td { border-color: rgba(68, 28, 82, 0.12); }
tbody tr:hover { background: rgba(121, 72, 143, 0.08); }

/* Flujo simplificado: sesión automática y QR como acción principal. */
.app-logo {
  overflow: hidden;
  background: rgba(255,255,255,0.72) !important;
  padding: 7px;
}

.app-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qr-block {
  display: block !important;
  min-height: 330px;
}

.qr-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 620px;
  margin: 0 auto;
}

.qr-brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin-bottom: 8px;
}

.qr-description { max-width: 480px; }

#pairQr {
  width: 190px;
  height: 190px;
  margin: 14px auto 8px;
  box-shadow: 0 12px 26px rgba(55, 20, 67, 0.15);
}

.contacts-tabs:empty { display: none; }

@media (max-width: 720px) {
  .qr-block { min-height: 300px; }
  #pairQr { width: 170px; height: 170px; }
}

/* Identidad visual ViaVox: video de fondo y paleta de la tarjeta corporativa. */
:root {
  --bg: #16002f;
  --card: rgba(28, 3, 55, 0.88);
  --card2: rgba(45, 5, 66, 0.78);
  --surface: rgba(67, 9, 88, 0.72);
  --border: rgba(241, 0, 180, 0.34);
  --border-bright: rgba(255, 0, 184, 0.62);
  --accent: #e600a9;
  --accent2: #8615d7;
  --accent-glow: rgba(230, 0, 169, 0.3);
  --text: #ffffff;
  --text2: #f0dff5;
  --muted: #cdb5d5;
}

body {
  position: relative;
  color: var(--text);
  background: #16002f;
  background-image: none;
}

.app-background-video,
.app-background-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

.app-background-video {
  z-index: -2;
  object-fit: cover;
  object-position: center;
  filter: saturate(112%) contrast(106%);
}

.app-background-overlay {
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(136, 20, 220, 0.12), transparent 38%),
    linear-gradient(135deg, rgba(19, 0, 45, 0.34), rgba(69, 0, 74, 0.26));
}

.layout { position: relative; z-index: 0; }

.panel {
  color: var(--text);
  background: linear-gradient(145deg, rgba(25, 2, 52, 0.48), rgba(53, 2, 65, 0.42));
  border: 1px solid rgba(236, 0, 179, 0.58);
  backdrop-filter: blur(7px) saturate(112%);
  -webkit-backdrop-filter: blur(7px) saturate(112%);
  box-shadow: 0 28px 70px rgba(10, 0, 25, 0.52), inset 0 1px rgba(255,255,255,0.06);
}

body .panel * { color: inherit !important; }
.app-title h1 { color: #fff !important; }
.app-title p,
.muted,
.campaign-status-line,
.campaign-list-empty,
.campaign-report-empty { color: var(--muted) !important; }

.session-bar,
.qr-block,
.campaign-panel,
.import-panel,
.worker-card,
.campaign-counter,
.campaign-report-card,
.edit-card,
.modal-card,
.apk-bar,
.campaign-card,
#contactsSection,
.import-preview,
.quotation-card {
  background: linear-gradient(145deg, rgba(38, 3, 67, 0.39), rgba(65, 3, 73, 0.32)) !important;
  border-color: rgba(231, 0, 177, 0.38) !important;
  box-shadow: inset 0 1px rgba(255,255,255,0.045), 0 12px 30px rgba(8,0,24,0.16);
  backdrop-filter: blur(5px) saturate(110%);
  -webkit-backdrop-filter: blur(5px) saturate(110%);
}

.status-pill,
.campaign-report-table-wrap {
  color: var(--text2) !important;
  background: rgba(22, 1, 44, 0.38);
  border-color: rgba(231, 0, 177, 0.25);
}

input,
select,
textarea {
  color: #fff !important;
  background: rgba(20, 1, 42, 0.72);
  border-color: rgba(236, 160, 224, 0.28);
}

input::placeholder,
textarea::placeholder { color: #bfa9ca !important; }

button:not(.danger-soft),
.btn-apk-dl,
.contacts-tabs button,
.import-tab,
.floating-add-btn {
  color: #fff !important;
  background: linear-gradient(135deg, #f000a9 0%, #9c08d2 100%);
  border-color: rgba(255,255,255,0.12);
  box-shadow: 0 8px 22px rgba(199, 0, 180, 0.24);
}

button:not(.danger-soft):hover,
.btn-apk-dl:hover,
.contacts-tabs button:hover,
.import-tab:hover {
  transform: translateY(-1px);
  filter: brightness(1.09);
  box-shadow: 0 11px 26px rgba(219, 0, 179, 0.34);
}

button.secondary,
button.icon-btn {
  color: #fff !important;
  background: rgba(126, 32, 157, 0.42);
  border-color: rgba(237, 183, 255, 0.25);
  box-shadow: none;
}

button.danger-soft {
  color: #ffe9f5 !important;
  background: rgba(196, 23, 104, 0.35);
  border-color: rgba(255, 124, 184, 0.30);
}

th {
  color: #fff !important;
  background: rgba(94, 12, 116, 0.92) !important;
}

td { color: var(--text2) !important; border-color: rgba(240, 192, 255, 0.10); }
tbody tr:hover { background: rgba(235, 0, 181, 0.09); }
a { color: #ff8dda !important; }
.app-logo { background: rgba(255,255,255,0.92) !important; }

.app-logo.app-logo-wide {
  width: 104px;
  height: 68px;
  padding: 0;
  overflow: visible;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none;
}

.app-logo.app-logo-wide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 9px 14px rgba(8, 0, 18, 0.38));
}

@media (max-width: 600px) {
  .app-logo.app-logo-wide { width: 82px; height: 54px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-background-video { display: none; }
  body {
    background: radial-gradient(circle at top, #4a0b68, #16002f 72%);
  }
}

/* Fondo estático violeta/fucsia. El video permanece disponible en los archivos. */
.app-background-video {
  display: none !important;
}

body {
  background-color: #7900d4;
  background-image:
    radial-gradient(circle at 16% 12%, rgba(199, 75, 255, 0.82), transparent 30%),
    radial-gradient(circle at 82% 22%, rgba(247, 0, 202, 0.44), transparent 36%),
    radial-gradient(circle at 50% 100%, rgba(112, 0, 209, 0.72), transparent 48%),
    linear-gradient(135deg, #6b00d7 0%, #a000df 48%, #7a00cf 100%);
  background-attachment: fixed;
}

.app-background-overlay {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 24%),
    radial-gradient(circle at 50% 45%, rgba(209, 85, 255, 0.18), transparent 46%);
}

.pairing-slot-current-call {
  gap: 8px;
  padding: 18px 14px 20px;
}

.pairing-slot-current-call > span {
  display: block;
  padding: 9px 0 11px 18px;
  line-height: 1.35;
}

.pairing-call-number-row {
  padding: 7px 0 5px;
}

.pairing-slot-current-call .pairing-call-number {
  margin-top: 0;
  padding: 2px 0;
  line-height: 1.25;
}

/* Tarjetas de equipos en lavanda con información magenta. */
.pairing-slot-card,
.pairing-slot-card.is-assigned {
  background: linear-gradient(145deg, #ead7f5 0%, #dfc5ef 100%) !important;
  border-color: rgba(238, 0, 178, 0.72) !important;
  box-shadow: 0 15px 32px rgba(72, 0, 105, 0.22), inset 0 1px rgba(255, 255, 255, 0.7) !important;
}

.pairing-slot-card .pairing-slot-top > strong,
.pairing-slot-card .pairing-slot-details > span,
.pairing-slot-card .pairing-slot-details > strong,
.pairing-slot-card .pairing-slot-current-call > span,
.pairing-slot-card .pairing-call-number,
.pairing-slot-card .pairing-call-company,
.pairing-slot-card .pairing-slot-qr-hint {
  color: #d900a9 !important;
}

.pairing-slot-card .pairing-slot-details,
.pairing-slot-card .pairing-slot-current-call {
  background: rgba(255, 255, 255, 0.30) !important;
  border-color: rgba(217, 0, 169, 0.24) !important;
}

.pairing-slot-card .pairing-slot-current-call,
.pairing-slot-card .pairing-slot-current-call.is-ringing,
.pairing-slot-card .pairing-slot-current-call.is-answered,
.pairing-slot-card .pairing-slot-current-call.is-ended {
  background: #ffffff !important;
}

.pairing-slot-card .pairing-slot-current-call .pairing-call-number {
  color: #6f169f !important;
}

.pairing-slot-card .pairing-slot-current-call .pairing-call-company,
.pairing-slot-card .pairing-slot-current-call > span {
  color: #df00aa !important;
}

.pairing-slot-card .pairing-slot-current-call .pairing-call-company {
  font-size: clamp(17px, 1.5vw, 21px);
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.pairing-slot-card .pairing-slot-state {
  color: #d900a9 !important;
  background: rgba(255, 255, 255, 0.42) !important;
  border-color: rgba(217, 0, 169, 0.30) !important;
}

.workers-board .worker-actions .worker-disconnect-btn {
  color: #ffe9f5 !important;
  background: rgba(196, 23, 104, 0.34) !important;
  border-color: rgba(255, 124, 184, 0.34) !important;
  box-shadow: none !important;
}

/* Leyenda integrada directamente sobre el video, sin bloque de fondo. */
.contact-status-legend {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
