/* ==========================================================================
   FixGo · app del tecnico + panel admin
   ========================================================================== */

/* ------------------------- Toggle "en linea" --------------------------- */
.online-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: var(--grad-surface);
  border: 1px solid var(--line-soft);
  transition: border-color var(--t), box-shadow var(--t);
}
.online-toggle.on {
  border-color: rgba(0, 229, 160, 0.42);
  box-shadow: 0 16px 40px -22px rgba(0, 229, 160, 0.7);
}
.online-dot {
  width: 14px; height: 14px;
  flex: none;
  border-radius: 50%;
  background: var(--muted-2);
  transition: background var(--t), box-shadow var(--t);
}
.online-toggle.on .online-dot {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(0, 229, 160, 0.18);
  animation: pulse-dot 1.8s infinite;
}

/* ------------------------- Solicitud entrante -------------------------- */
.incoming {
  position: fixed;
  inset: 0;
  z-index: 950;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 6, 13, 0.86);
  backdrop-filter: blur(10px);
  animation: fade-in 0.2s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.incoming-card {
  width: min(420px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  padding: 24px;
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, #16203a, #0c1322);
  border: 1px solid rgba(79, 123, 255, 0.4);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.95), var(--glow);
  animation: pop-in 0.36s var(--ease);
}
.incoming-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.incoming-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px; height: 48px;
  flex: none;
  border-radius: 50%;
  background: var(--grad-brand);
  color: #fff;
}
.incoming-ring::before {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 2px solid rgba(79, 123, 255, 0.55);
  animation: ring 1.5s var(--ease) infinite;
}
.incoming-ring svg { width: 23px; height: 23px; }
.incoming-price {
  text-align: right;
  margin-left: auto;
}
.incoming-price b { font-size: 26px; font-weight: 820; letter-spacing: -0.04em; display: block; }
.incoming-actions { display: flex; gap: 10px; margin-top: 20px; }
.incoming-actions .btn { flex: 1; }
.incoming-timer {
  height: 4px;
  border-radius: var(--pill);
  background: rgba(148, 163, 184, 0.18);
  overflow: hidden;
  margin-top: 16px;
}
.incoming-timer i {
  display: block;
  height: 100%;
  background: var(--grad-mint);
  transition: width 1s linear;
}

/* ----------------------------- Cola / lista ---------------------------- */
.queue-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: var(--r);
  background: var(--grad-surface);
  border: 1px solid var(--line-soft);
  transition: border-color var(--t);
}
.queue-item + .queue-item { margin-top: 10px; }
.queue-item.fresh { border-color: rgba(0, 229, 160, 0.4); animation: fade-up 0.4s var(--ease); }

/* --------------------------- Panel admin (tabla) ----------------------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 560px;
}
table.data th {
  text-align: left;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background var(--t); }
table.data tbody tr:hover { background: rgba(79, 123, 255, 0.05); }

.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell b { font-size: 13.5px; display: block; }
.user-cell span { font-size: 11.5px; color: var(--muted); }

/* Admin: KPI cards */
.kpi-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px) { .kpi-row { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  padding: 15px;
  border-radius: var(--r);
  background: var(--grad-surface);
  border: 1px solid var(--line-soft);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(79, 123, 255, 0.09);
}
.kpi-val {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  position: relative;
}
.kpi-key { font-size: 11.5px; color: var(--muted); margin-top: 4px; font-weight: 600; position: relative; }
.kpi svg { width: 15px; height: 15px; margin-right: 4px; vertical-align: -2px; }

/* Admin: barra de estados */
.bar-chart { display: grid; gap: 9px; }
.bar-row { display: flex; align-items: center; gap: 11px; }
.bar-key { font-size: 12.5px; min-width: 96px; color: var(--muted); font-weight: 600; }
.bar-track { flex: 1; height: 9px; border-radius: var(--pill); background: rgba(148, 163, 184, 0.13); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--pill); transition: width 0.7s var(--ease); }
.bar-val { font-size: 12.5px; font-weight: 700; min-width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

/* Admin: generar cuenta de soporte */
.gen-form { display: grid; gap: 12px; }
.pw-toggle { position: relative; }
.pw-toggle .input { padding-right: 46px; }
.pw-toggle button {
  position: absolute;
  right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 36px; height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--muted);
}
.pw-toggle button:active { background: rgba(255, 255, 255, 0.06); }

.gen-done {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border-radius: var(--r);
  background: rgba(0, 229, 160, 0.1);
  border: 1px solid rgba(0, 229, 160, 0.3);
  font-size: 13px;
  font-weight: 600;
  color: #8bffd4;
  word-break: break-all;
}

/* Admin: tabs */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(6, 11, 20, 0.6);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  flex: 1;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  white-space: nowrap;
  transition: all var(--t);
}
.seg button.active { background: var(--grad-brand); color: #fff; box-shadow: 0 6px 18px -8px rgba(79, 123, 255, 0.9); }

/* Notas del tecnico */
.note-box {
  width: 100%;
  padding: 12px 14px;
  min-height: 84px;
  border-radius: var(--r);
  background: rgba(6, 11, 20, 0.6);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  resize: vertical;
  line-height: 1.55;
}
.note-box:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(79, 123, 255, 0.14); }

/* Panel tecnico en desktop */
@media (min-width: 900px) {
  .tech-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    align-items: start;
  }
}
