/* ==========================================================================
   ESTILOS GLOBALES Y PANTALLA DE LLAMADA — Diseño Admin + Réplica Dialer
   Proyecto: Simulador de Llamadas (SIMULAR-LLAMADA)
   Tablas BD afectadas: N/A (LocalStorage)
   Última actualización: 2026-10-15
   ========================================================================== */

/* --- VARIABLES GLOBALES Y RESET --- */
:root {
  --bg-dark: #0d181c;
  --bg-card: rgba(20, 37, 43, 0.82);
  --border-glass: rgba(255, 255, 255, 0.11);
  --text-main: #f3f7f9;
  --text-muted: #9cb0b8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --accent: #7367F0;
  --call-red: #f03a32;
  --call-btn-bg: rgba(162, 216, 232, 0.22);
  --call-btn-active-bg: #e3eaee;
  --call-btn-active-icon: #182226;
}

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

html, body {
  max-width: 100vw;
  overflow-x: hidden;
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Roboto', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.hidden-view {
  display: none !important;
}

.fila-oculta {
  display: none !important;
}

/* --- VISTA 1: MÓDULO ADMINISTRADOR --- */
.admin-view {
  width: 100%;
  max-width: 100vw;
  min-height: 100dvh;
  overflow-x: hidden;
  padding: 1.25rem 1rem 3rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(29, 102, 95, 0.35), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(38, 73, 102, 0.35), transparent 50%),
    linear-gradient(180deg, #0c171b 0%, #102127 100%);
}

.admin-container {
  width: 100%;
  max-width: 1080px;
  min-width: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.glass-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 18px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

/* Cabecera del Administrador */
.admin-header {
  padding: 1.15rem 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-width: 0;
  flex: 1 1 240px;
}

.brand-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1d665f, #2b8a7e);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(29, 102, 95, 0.45);
}

.admin-title {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.admin-subtitle {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  line-height: 1.35;
}

.header-actions-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.btn-install-pwa {
  min-height: 46px;
  padding: 0.68rem 1.05rem;
  border-radius: 12px;
  border: 1px solid rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
  max-width: 100%;
}

.btn-install-pwa:hover {
  background: rgba(59, 130, 246, 0.28);
  color: #ffffff;
}

.btn-quick-launch {
  min-height: 46px;
  padding: 0.7rem 1.15rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--success), #059669);
  color: #ffffff;
  font-size: 0.93rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  max-width: 100%;
  text-align: center;
}

.btn-quick-launch:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.45);
}

.btn-quick-launch:active {
  transform: scale(0.98);
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: pulseDot 1.6s infinite;
}

@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.75); }
  70% { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

/* Grilla 2 Columnas del Admin (Usar minmax(0, ...) para evitar expansión en móvil) */
.admin-grid {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 1.25rem;
  align-items: start;
}

.config-panel,
.contacts-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 1.35rem;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 1.1rem;
  min-width: 0;
}

.section-title {
  font-size: 1.02rem;
  font-weight: 600;
  color: #ffffff;
  min-width: 0;
}

.section-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.35;
}

.badge-live {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
  flex-shrink: 0;
}

/* Formulario Configurador */
.config-form {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-group {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 0;
}

.form-label {
  font-size: 0.84rem;
  font-weight: 500;
  color: #d0dfe5;
}

.form-input,
.form-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0.62rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 22, 26, 0.75);
  color: #ffffff;
  font-size: 0.94rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: #2dd4bf;
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

/* Píldoras de Tiempo Rápido */
.preset-time-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.time-pill {
  padding: 0.26rem 0.58rem;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.time-pill:hover,
.time-pill.is-selected {
  background: rgba(45, 212, 191, 0.2);
  border-color: #2dd4bf;
  color: #ffffff;
}

.time-inputs-row {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.time-box {
  position: relative;
  width: 92px;
  flex-shrink: 0;
}

.time-number-input {
  padding-right: 2.2rem;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.time-unit {
  position: absolute;
  right: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.74rem;
  color: var(--text-muted);
  pointer-events: none;
}

.time-separator {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-muted);
}

.toggle-Timer-live {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
  margin-left: auto;
  font-size: 0.84rem;
  color: #e2e8f0;
  min-height: 40px;
}

.toggle-Timer-live input {
  accent-color: var(--success);
  width: 18px;
  height: 18px;
  cursor: pointer;
  flex-shrink: 0;
}

.form-row-two {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.85rem;
}

/* Switches de Opciones */
.switches-box {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.switch-item {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.83rem;
  line-height: 1.38;
  color: #d5e3e8;
  cursor: pointer;
}

.switch-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #14b8a6;
  flex-shrink: 0;
  cursor: pointer;
}

.switch-label {
  flex: 1;
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

/* Botones del Formulario */
.form-actions {
  width: 100%;
  min-width: 0;
  display: flex;
  gap: 0.75rem;
  margin-top: 0.35rem;
  flex-wrap: wrap;
}

.btn-primary-call {
  flex: 1 1 210px;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  color: #ffffff;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  box-shadow: 0 8px 20px rgba(20, 184, 166, 0.3);
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn-primary-call:hover {
  filter: brightness(1.07);
  transform: translateY(-1px);
}

.btn-secondary-save {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #f1f5f9;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-align: center;
  transition: background 0.15s ease;
}

.btn-secondary-save:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* Agenda de Contactos */
.btn-link-reset {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text-muted);
  font-size: 0.76rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  min-height: 34px;
}

.btn-link-reset:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

.search-box {
  position: relative;
  margin-bottom: 0.9rem;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  padding-left: 2.5rem;
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.contact-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.9rem;
  border-radius: 13px;
  background: rgba(11, 24, 29, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.contact-card:hover {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(17, 36, 43, 0.88);
}

.contact-card.is-active-preset {
  border-color: rgba(20, 184, 166, 0.55);
  background: rgba(20, 184, 166, 0.1);
}

.contact-info {
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.contact-name-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.contact-name {
  font-size: 0.96rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-time-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #99f6e4;
  font-variant-numeric: tabular-nums;
}

.contact-number {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.18rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-card-call {
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.85rem;
  border-radius: 10px;
  border: none;
  background: var(--success);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: filter 0.15s ease;
}

.btn-card-call:hover {
  filter: brightness(1.1);
}

.btn-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-card-icon:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.btn-card-icon.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}

/* ==========================================================================
   VISTA 2: PANTALLA DE LLAMADA SIMULADA (RÉPLICA EXACTA DE LA CAPTURA)
   ========================================================================== */
.call-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  z-index: 900;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
}

/* Fondo Aurora Difuminado idéntico a la captura original (Cyan, Turquesa, Azul Océano y Verde Petróleo) */
.call-bg-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: #19383c;
  background-image:
    radial-gradient(ellipse 82% 50% at 14% 10%, #718b93 0%, rgba(113, 139, 147, 0) 72%),
    radial-gradient(ellipse 75% 52% at 88% 34%, #1e7166 0%, rgba(30, 113, 102, 0) 74%),
    radial-gradient(ellipse 68% 46% at 38% 53%, #3b8888 0%, rgba(59, 136, 136, 0) 68%),
    radial-gradient(ellipse 72% 52% at 14% 75%, #2f6c99 0%, rgba(47, 108, 153, 0) 70%),
    radial-gradient(ellipse 88% 58% at 72% 94%, #183337 0%, #162d31 100%);
}

/* Barra de Estado Superior Simulada (4:55, VoLTE 1, 4G, Batería 67) */
.fake-status-bar {
  width: 100%;
  max-width: 440px;
  padding: 10px 20px 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.94);
  flex-shrink: 0;
}

.status-left {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-clock {
  font-weight: 500;
  font-size: 15px;
}

.status-warn-icon {
  opacity: 0.92;
}

.status-right {
  display: flex;
  align-items: center;
  gap: 5.5px;
}

.status-icon-speaker {
  opacity: 0.92;
}

.status-volte-group {
  display: flex;
  flex-direction: column;
  line-height: 0.92;
  font-size: 8.2px;
  font-weight: 700;
  letter-spacing: -0.02em;
  opacity: 0.94;
}

.status-signal-group {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  position: relative;
}

.status-4g-badge {
  font-size: 8.2px;
  font-weight: 700;
  line-height: 1;
  margin-right: 1px;
  align-self: flex-start;
  margin-top: 1px;
}

.status-sim2-top {
  position: absolute;
  top: -1px;
  left: 0;
  opacity: 0.9;
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 1.8px;
  height: 12px;
}

.signal-bars .bar {
  width: 2.3px;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.35);
}

.signal-bars .bar.active {
  background: rgba(255, 255, 255, 0.95);
}

.signal-bars .b1 { height: 4px; }
.signal-bars .b2 { height: 6.5px; }
.signal-bars .b3 { height: 9px; }
.signal-bars .b4 { height: 11.5px; }

/* Batería Amarilla 67 + Punto Verde */
.status-battery-wrap {
  display: flex;
  align-items: center;
  margin-left: 2px;
}

.status-battery-pill {
  background: #f2bf3c;
  color: #1a211e;
  font-size: 10.5px;
  font-weight: 700;
  height: 15px;
  min-width: 24px;
  padding: 0 4px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.status-battery-tip {
  width: 2px;
  height: 6px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 0 1px 1px 0;
  margin-left: 1px;
}

.status-mic-privacy-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  margin-left: 6px;
}

/* --- CABECERA CENTRAL: NOMBRE, NÚMERO Y CRONÓMETRO (35:56) --- */
.caller-info-area {
  width: 100%;
  max-width: 420px;
  margin-top: clamp(3.6rem, 11.5vh, 6rem);
  margin-bottom: auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.caller-name {
  font-size: clamp(2.15rem, 6.8vw, 2.38rem);
  font-weight: 500;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.16;
  word-break: break-word;
}

.caller-number {
  margin-top: 0.55rem;
  font-size: 1.01rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.64);
  letter-spacing: 0.01em;
}

.caller-meta-row {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.64);
}

.meta-volte {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.9;
  font-size: 7.8px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: 0.01em;
}

/* Icono de tarjeta SIM con esquinasuperior derecha recortada y número 1 */
.meta-sim-card {
  width: 12px;
  height: 14px;
  background: rgba(255, 255, 255, 0.66);
  color: #21595a;
  border-radius: 2px;
  clip-path: polygon(0 0, 70% 0, 100% 28%, 100% 100%, 0 100%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
}

.call-timer {
  font-size: 0.97rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.66);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.015em;
}

.dtmf-typed-display {
  margin-top: 0.75rem;
  font-size: 1.45rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: #ffffff;
  min-height: 1.8rem;
}

/* --- GRILLA INFERIOR DE CONTROLES (3x3) --- */
.call-bottom-area {
  width: 100%;
  max-width: 412px;
  padding: 0 1.25rem clamp(2.2rem, 4.8vh, 3.1rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1.35rem, 3.1vh, 2rem);
}

.call-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  row-gap: clamp(1.3rem, 3vh, 1.85rem);
  column-gap: 0.35rem;
  justify-items: center;
}

.call-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.48rem;
}

/* En Videollamada, el círculo conserva su brillo y solo el icono y texto van atenuados */
.call-action-item.is-video-disabled .call-ctrl-btn svg {
  opacity: 0.5;
}

.call-action-item.is-video-disabled .call-action-label {
  color: rgba(255, 255, 255, 0.44);
}

.call-action-item.is-video-disabled .call-ctrl-btn.is-active svg {
  opacity: 1;
}

/* Botones Circulares de la Llamada (Tamaño amplio 72-76px idéntico a captura) */
.call-ctrl-btn {
  width: clamp(68px, 19.2vw, 75px);
  height: clamp(68px, 19.2vw, 75px);
  border-radius: 50%;
  border: none;
  background: rgba(142, 218, 240, 0.23);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.12s ease, background-color 0.16s ease, color 0.16s ease;
}

.call-ctrl-btn:active {
  transform: scale(0.94);
}

/* Estado Activo (Blanco hielo #d3e0e5 e icono oscuro #182226 como Altavoz en la captura) */
.call-ctrl-btn.is-active {
  background: #d3e0e5;
  color: #182226;
}

.call-action-label {
  font-size: 0.84rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.86);
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.005em;
}

/* Fila 3 Inferior (Teclado, Colgar, Altavoz) */
.call-bottom-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 0.35rem;
  justify-items: center;
  align-items: center;
  margin-top: 0.2rem;
}

.call-bottom-slot {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Botón Rojo de Colgar (Rojo plano #f0382e sin sombra artificial) */
.btn-hangup {
  background: #f0382e !important;
  color: #ffffff !important;
  box-shadow: none;
}

.btn-hangup:hover {
  filter: brightness(1.05);
}

/* Teclado Numérico Superpuesto (DTMF) */
.dialpad-overlay {
  width: 100%;
  padding: 0.5rem 0.25rem;
  animation: fadeInDialpad 0.18s ease;
}

@keyframes fadeInDialpad {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.dialpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  row-gap: 0.65rem;
  column-gap: 0.75rem;
  justify-items: center;
}

.dialpad-key {
  width: 64px;
  height: 54px;
  border-radius: 28px;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.12s ease;
}

.dialpad-key:active {
  background: rgba(255, 255, 255, 0.28);
}

.dk-num {
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.05;
}

.dk-sub {
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.65);
  min-height: 0.7rem;
}

/* Barra Gestual Inferior de Android */
.gesture-nav-pill {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 134px;
  height: 4.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  pointer-events: none;
}

/* --- OVERLAY DE CUENTA REGRESIVA --- */
.countdown-overlay {
  position: fixed;
  inset: 0;
  z-index: 950;
  background: rgba(8, 17, 21, 0.86);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.countdown-card {
  max-width: 360px;
  width: 100%;
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.countdown-Number {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: rgba(20, 184, 166, 0.18);
  border: 2px solid #14b8a6;
  color: #2dd4bf;
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 1rem;
  color: #ffffff;
}

.countdown-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.btn-cancel-countdown {
  margin-top: 0.5rem;
  min-height: 44px;
  padding: 0.6rem 1.25rem;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  font-weight: 600;
  cursor: pointer;
}

/* --- MODAL DE CONFIRMACIÓN Y TOASTS --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 12, 15, 0.78);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  max-width: 380px;
  width: 100%;
  padding: 1.4rem;
}

.modal-title {
  font-size: 1.08rem;
  font-weight: 600;
  color: #ffffff;
}

.modal-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.btn-modal-danger,
.btn-modal-cancel {
  flex: 1;
  min-height: 44px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-modal-danger {
  border: none;
  background: var(--danger);
  color: #ffffff;
}

.btn-modal-cancel {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
}

/* Toasts */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: min(340px, calc(100vw - 2rem));
}

.toast-item {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(15, 30, 36, 0.95);
  border-left: 4px solid var(--success);
  color: #ffffff;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  animation: toastSlideIn 0.2s ease;
}

.toast-item.toast-info { border-left-color: var(--info); }
.toast-item.toast-warning { border-left-color: var(--warning); }
.toast-item.toast-danger { border-left-color: var(--danger); }

@keyframes toastSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- RESPONSIVE ADAPTATIVO (< 860px, <= 480px y <= 380px) --- */
@media (max-width: 860px) {
  .admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-header {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
  }

  .admin-brand {
    flex: none !important;
    width: 100%;
  }

  .header-actions-wrap {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }

  .btn-quick-launch,
  .btn-install-pwa {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .admin-view {
    padding: 0.75rem 0.65rem 2.5rem;
  }

  .config-panel,
  .contacts-panel {
    padding: 0.95rem 0.85rem;
    border-radius: 14px;
  }

  .form-row-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .time-inputs-row {
    gap: 0.45rem;
  }

  .time-box {
    flex: 1 1 90px;
    width: auto;
  }

  .toggle-Timer-live {
    width: 100%;
    margin-left: 0;
    padding-top: 0.2rem;
  }

  .form-actions {
    flex-direction: column;
  }

  .btn-primary-call,
  .btn-secondary-save {
    width: 100%;
    flex: none !important;
  }

  .contact-card {
    flex-wrap: wrap;
    padding: 0.75rem;
  }

  .contact-info {
    flex: 1 1 100%;
  }

  .contact-actions {
    width: 100%;
    justify-content: flex-end;
    padding-top: 0.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
  }

  .btn-card-call {
    flex: 1;
  }
}

@media (max-width: 380px) {
  .admin-view {
    padding: 0.55rem 0.5rem 2rem;
  }

  .config-panel,
  .contacts-panel {
    padding: 0.85rem 0.7rem;
  }

  .call-bottom-area {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .call-action-label {
    font-size: 0.76rem;
  }
}

