.pf-page {
  font-family: "Poppins", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 170px);
}

.pf-header {
  margin-bottom: 20px;
  flex-shrink: 0;
}

.pf-title {
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 6px 0;
  color: #111827;
}

.pf-subtitle {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

/* ── Grid de cards ── */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 250px));
  justify-content: center;
  align-content: center;
  flex: 1;
  gap: 26px;
  width: 100%;
}

.pf-card {
  perspective: 1200px;
  width: 100%;
  max-width: 250px;
  aspect-ratio: 5 / 7.5;
  cursor: pointer;
  margin: 0 auto;
}

.pf-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.pf-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.pf-card-face-back {
  transform: rotateY(180deg);
}

/* ── Overlay de acciones en hover: Editar Perfil / Editar Correo ── */
.pf-card-hover-actions {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.82);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pf-card:hover .pf-card-hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.pf-card-action-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pf-card-action-btn:hover {
  background: #2563eb;
  border-color: #2563eb;
}

.pf-card-action-btn.pf-action-correo:hover {
  background: #059669;
  border-color: #059669;
}

.pf-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #eff6ff;
  color: #2563eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.pf-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  text-align: center;
  margin-bottom: 12px;
}

.pf-card-correo-btn {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  padding: 7px 10px;
  font-size: 0.78rem;
  color: #4b5563;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: default;
}

.pf-card-correo-btn i {
  color: #9ca3af;
  flex-shrink: 0;
}

.pf-card-badges {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.pf-card-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #eff6ff;
  color: #1e40af;
}

.pf-card-badge-sms {
  background: #fef3c7;
  color: #92400e;
}

/* ── Proxy de animacion: flip + crecimiento + centrado ── */
.pf-flip-proxy {
  position: fixed;
  z-index: 100002;
  perspective: 1600px;
  transform: none;
  transform-origin: top left;
}

.pf-flip-proxy-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
}

.pf-flip-proxy.is-flipped .pf-flip-proxy-inner {
  transform: rotateY(180deg);
}

.pf-flip-proxy-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 16px;
}

.pf-flip-proxy-back {
  transform: rotateY(180deg);
}

/* ── Overlay expandido (tablero de alertas + horas) ── */
.pf-expand-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.pf-expand-overlay.is-visible {
  opacity: 1;
}

.pf-expand-panel {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 1200px;
  height: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 30px 32px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  transform: scale(0.9);
  transition: transform 0.25s ease;
}

.pf-expand-overlay.is-visible .pf-expand-panel {
  transform: scale(1);
}

.pf-expand-close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.pf-expand-close:hover {
  color: #111827;
}

.pf-expand-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 20px;
}

.pf-expand-board {
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 0.9fr;
  gap: 18px;
  align-items: start;
}

.pf-expand-col {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 14px;
  background: #f9fafb;
  min-height: 380px;
  max-height: 60vh;
  overflow-y: auto;
}

.pf-expand-col-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.pf-expand-alertas-actuales.pf-drop-active {
  border-color: #2563eb;
  border-style: dashed;
  background: #eff6ff;
}

.pf-alertas-actuales-list,
.pf-alertas-disponibles-list {
  display: grid;
  gap: 7px;
}

.pf-alerta-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  background: #fff;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.82rem;
  color: #1e3a8a;
}

.pf-alerta-chip.pf-sms {
  border-color: #f59e0b;
  color: #92400e;
}

.pf-alerta-chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  opacity: 0.7;
}

.pf-alerta-chip-remove:hover {
  opacity: 1;
}

.pf-alerta-drag {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.82rem;
  color: #1f2937;
  background: #fff;
  cursor: grab;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.pf-alerta-drag:active {
  cursor: grabbing;
}

.pf-alerta-drag.dragging {
  opacity: 0.4;
}

.pf-alerta-drag-sms-badge {
  font-size: 0.64rem;
  font-weight: 800;
  color: #92400e;
  background: #fef3c7;
  border-radius: 4px;
  padding: 1px 5px;
}

.pf-horario-hint {
  font-size: 0.78rem;
  color: #6b7280;
  margin-bottom: 14px;
}

.pf-horario-field {
  margin-bottom: 14px;
}

.pf-horario-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 4px;
}

.pf-expand-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.pf-horario-divider {
  border-top: 1px solid #e5e7eb;
  margin: 16px 0 14px;
}

.pf-finde-custom {
  margin-bottom: 4px;
}

[data-theme="dark"] .pf-horario-divider,
.dark-theme .pf-horario-divider {
  border-color: #374151;
}

.pf-empty {
  color: #6b7280;
  font-size: 0.85rem;
  padding: 8px 0;
}

/* ── Popup pequeno: correo + numeros ── */
.pf-correo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.pf-correo-modal {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  padding: 26px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.pf-correo-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.pf-correo-close:hover {
  color: #111827;
}

.pf-correo-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
}

.pf-correo-numeros-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 22px;
}

.pf-numero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.78rem;
}

.pf-numero-chip-remove {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
}

.pf-numero-add-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.pf-numero-add-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.pf-correo-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

/* ── Toasts ── */
.pf-toast-stack {
  position: fixed;
  top: 80px;
  right: 18px;
  z-index: 199999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.pf-toast {
  min-width: 280px;
  max-width: 420px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1f2937;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  pointer-events: auto;
  opacity: 0;
  transform: translateX(26px);
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.pf-toast.is-entered {
  opacity: 1;
  transform: translateX(0);
}

.pf-toast.is-leaving {
  opacity: 0;
  transform: translateX(-22px);
}

.pf-toast-body {
  padding: 11px 12px 9px;
  font-size: 0.9rem;
  font-weight: 500;
}

.pf-toast-success { border-color: #10b981; }
.pf-toast-info { border-color: #3b82f6; }
.pf-toast-warning { border-color: #f59e0b; }
.pf-toast-danger { border-color: #ef4444; }

.pf-toast-progress {
  height: 3px;
  width: 100%;
  background: #1f2937;
  transition-property: width;
  transition-timing-function: linear;
}

/* ── Responsive ── */
@media (max-width: 992px) {
  .pf-expand-board {
    grid-template-columns: 1fr;
  }
  .pf-expand-col {
    max-height: 260px;
  }
}

@media (max-width: 640px) {
  .pf-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pf-expand-panel {
    padding: 22px 16px;
    max-height: 96vh;
  }
  .pf-toast-stack {
    top: 70px;
    right: 10px;
    left: 10px;
  }
  .pf-toast {
    max-width: none;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .pf-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Dark theme ── */
[data-theme="dark"] .pf-title,
[data-theme="dark"] .pf-card-name,
[data-theme="dark"] .pf-expand-title,
[data-theme="dark"] .pf-expand-col-title,
[data-theme="dark"] .pf-correo-title,
.dark-theme .pf-title,
.dark-theme .pf-card-name,
.dark-theme .pf-expand-title,
.dark-theme .pf-expand-col-title,
.dark-theme .pf-correo-title {
  color: #f3f4f6;
}

[data-theme="dark"] .pf-subtitle,
[data-theme="dark"] .pf-horario-hint,
[data-theme="dark"] .pf-empty,
.dark-theme .pf-subtitle,
.dark-theme .pf-horario-hint,
.dark-theme .pf-empty {
  color: #9ca3af;
}

[data-theme="dark"] .pf-card-face,
[data-theme="dark"] .pf-flip-proxy-face,
[data-theme="dark"] .pf-expand-panel,
[data-theme="dark"] .pf-correo-modal,
[data-theme="dark"] .pf-expand-col,
[data-theme="dark"] .pf-alerta-drag,
[data-theme="dark"] .pf-alerta-chip,
.dark-theme .pf-card-face,
.dark-theme .pf-flip-proxy-face,
.dark-theme .pf-expand-panel,
.dark-theme .pf-correo-modal,
.dark-theme .pf-expand-col,
.dark-theme .pf-alerta-drag,
.dark-theme .pf-alerta-chip {
  background: #1f2937;
  border-color: #4b5563;
  color: #e5e7eb;
}

[data-theme="dark"] .pf-card-correo-btn,
.dark-theme .pf-card-correo-btn {
  background: #111827;
  border-color: #4b5563;
  color: #d1d5db;
}

/* ── Breadcrumb de navegacion pais/flota ── */
.pf-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
}

.pf-breadcrumb-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  color: #1e40af;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 7px 14px;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.pf-breadcrumb-link:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  transform: translateX(-2px);
}

.pf-breadcrumb-link i {
  font-size: 0.75rem;
}

.pf-breadcrumb-sep {
  color: #9ca3af;
}

/* ── Vistas (pais / flota / perfil) ── */
.pf-view {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pf-view-hidden {
  display: none;
}

.pf-view-perfiles-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}

/* ── Cards de pais / flota: verticales, con mapa, candado si bloqueado ── */
.pf-grid-paises,
.pf-grid-flotas {
  grid-template-columns: repeat(auto-fit, minmax(260px, 320px));
}

.pf-geo-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 5 / 7;
  margin: 0 auto;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pf-geo-card.pf-geo-card-clickable:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.pf-geo-card-map {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 22px 6px;
}

.pf-geo-card-map svg {
  width: 100%;
  height: 100%;
  max-height: 260px;
}

.pf-geo-map-border {
  fill: none;
  stroke-width: 2.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  stroke: #d52b1e;
}

.pf-geo-card-pin {
  font-size: 2.6rem;
  color: #9ca3af;
}

.pf-geo-card-footer {
  padding: 14px 18px 18px;
  text-align: center;
  border-top: 1px solid #f3f4f6;
}

.pf-geo-card-name {
  font-size: 1rem;
  font-weight: 800;
  color: #111827;
  letter-spacing: -0.01em;
}

.pf-geo-card-badge {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 11px;
  border-radius: 20px;
  background: #eff6ff;
  color: #1e40af;
}

.pf-geo-card-lock {
  position: absolute;
  top: 14px;
  right: 14px;
  color: #9ca3af;
  font-size: 1rem;
}

.pf-geo-card.pf-geo-card-locked {
  cursor: default;
  opacity: 0.65;
}

.pf-geo-card.pf-geo-card-locked .pf-geo-map-border {
  stroke: #9ca3af;
}

/* ── Card de perfil inactivo (candado, no clickeable) ── */
.pf-card.pf-card-locked {
  cursor: default;
}

.pf-card.pf-card-locked .pf-card-face {
  opacity: 0.6;
}

.pf-card-lock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  color: #9ca3af;
  font-size: 0.95rem;
  z-index: 2;
}

.pf-card.pf-card-locked .pf-card-hover-actions {
  display: none;
}

/* ── Dark theme: nuevos elementos ── */
[data-theme="dark"] .pf-breadcrumb-sep,
.dark-theme .pf-breadcrumb-sep {
  color: #6b7280;
}

[data-theme="dark"] .pf-breadcrumb-link,
.dark-theme .pf-breadcrumb-link {
  background: #1e3a5f;
  border-color: #2563eb;
  color: #bfdbfe;
}

[data-theme="dark"] .pf-breadcrumb-link:hover,
.dark-theme .pf-breadcrumb-link:hover {
  background: #1e40af;
  border-color: #3b82f6;
}

[data-theme="dark"] .pf-geo-card,
.dark-theme .pf-geo-card {
  background: #1f2937;
  border-color: #4b5563;
}

[data-theme="dark"] .pf-geo-card-footer,
.dark-theme .pf-geo-card-footer {
  border-color: #374151;
}

[data-theme="dark"] .pf-geo-card-name,
.dark-theme .pf-geo-card-name {
  color: #f3f4f6;
}
