:root {
  --sidebar-bg-top: #9b44e6;
  --sidebar-bg-bottom: #5e1cb2;
  --sidebar-active: #b56ff1;
  --sidebar-hover: #b56ff144;
  --topbar-bg: #ffffff;
  --main-bg: #f8f9fc;

  --card-orange: #ff7e15;
  --card-blue: #4086f4;
  --card-green: #13c28c;
  --card-yellow: #fed100;
  --btn-purple: #8646ed;

  --text-dark: #2c323f;
  --text-muted: #828c9b;

  --border-radius-lg: 12px;
  --border-radius-md: 8px;
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 8px 20px rgba(0, 0, 0, 0.08);

  --sidebar-width: 250px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--main-bg);
  color: var(--text-dark);
}

/* Layout */
.dashboard-wrapper {
  display: flex;
  height: 100vh;
}


/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--sidebar-bg-top), var(--sidebar-bg-bottom));
  display: flex;
  flex-direction: column;
  color: white;
  flex-shrink: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}


.sidebar-logo {
  padding: 30px;
  display: flex;
  justify-content: center;
}

.sidebar-logo .logo-circle {
  width: 60px;
  height: 60px;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  /* glassmorphism simple */
  backdrop-filter: blur(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0 15px;
  overflow-y: auto;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  margin-bottom: 5px;
  border-radius: 8px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.sidebar-link i {
  width: 24px;
  font-size: 1.1rem;
  margin-right: 10px;
}

.sidebar-link:hover {
  background-color: var(--sidebar-hover);
  color: white;
}

.sidebar-link.active {
  background-color: var(--sidebar-active);
}

.sidebar-footer {
  padding: 20px 30px;
}

.sidebar-footer .sidebar-link {
  margin: 0;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Topbar */
.topbar {
  height: 70px;
  background-color: var(--topbar-bg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  z-index: 900;
  position: sticky;
  top: 0;
}

.hamburger-menu {
  display: none;
  font-size: 1.5rem;
  color: var(--text-dark);
  cursor: pointer;
  margin-right: 15px;
}


.topbar-stripe {
  height: 5px;
  background: linear-gradient(90deg, var(--sidebar-bg-top), var(--btn-purple));
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.topbar-left {
  flex: 1;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: var(--card-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.user-info {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-client {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Content Area */
.content-area {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
}

/* Top Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  padding: 24px;
  border-radius: var(--border-radius-lg);
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.stat-card.orange {
  background-color: var(--card-orange);
}

.stat-card.blue {
  background-color: var(--card-blue);
}

.stat-card.green {
  background-color: var(--card-green);
}

.stat-card-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.stat-card-desc {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.4;
  margin-bottom: 15px;
}

.stat-card-btn {
  background-color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: all 0.2s;
}

.stat-card.orange .stat-card-btn {
  color: var(--card-orange);
}

.stat-card.blue .stat-card-btn {
  color: var(--card-blue);
}

.stat-card.green .stat-card-btn {
  color: var(--card-green);
}

.stat-card-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.stat-badge {
  position: absolute;
  bottom: 24px;
  right: 24px;
  font-size: 0.75rem;
  text-align: right;
  font-weight: 600;
}

/* Main Grid Layout */
.dashboard-main-grid {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 20px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: minmax(180px, auto);
  gap: 20px;
}

.action-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius-md);
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
  position: relative;
}

.action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg, var(--sidebar-bg-top), var(--card-blue));
  border-top-left-radius: var(--border-radius-md);
  border-top-right-radius: var(--border-radius-md);
}

.action-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.action-icon {
  width: 50px;
  height: 50px;
  background-color: var(--btn-purple);
  color: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 20px;
  box-shadow: 0 4px 10px rgba(134, 70, 237, 0.4);
}

.action-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 10px;
  white-space: nowrap;
}

.action-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
  margin-bottom: 20px;
}

.action-btn {
  background-color: var(--btn-purple);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 90%;
}

.action-btn:hover {
  background-color: var(--sidebar-bg-bottom);
  box-shadow: 0 4px 10px rgba(134, 70, 237, 0.4);
}

/* Ad Sidebar (Yellow) */
.ad-sidebar {
  background-color: var(--card-yellow);
  border-radius: var(--border-radius-md);
  padding: 40px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.ad-slide {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex: 1;
}

.ad-icon-wrapper {
  width: 100px;
  height: 100px;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.ad-icon {
  font-size: 3rem;
  color: var(--card-blue);
  /* matching the inner blue cart in image */
  opacity: 0.7;
}

.ad-text-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.ad-title {
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.ad-desc {
  font-size: 0.9rem;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 15px;
}

.ad-actions {
  width: 100%;
  margin-bottom: 15px;
}

.ad-btn {
  background-color: var(--text-dark);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  width: 90%;
}

.ad-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.ad-btn.white-btn {
  background-color: white;
  color: var(--text-dark);
}

.ad-dots {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.2);
}

.dot.active {
  background-color: var(--text-dark);
}

/* Fix blazor unhandled error ui hiding */
#blazor-error-ui {
  display: none;
}

/* --- NEW COMPONENTS CSS --- */

/* Utility Cards & Colors */
.white-card {
  background-color: #ffffff;
  border-radius: var(--border-radius-md);
}

.bg-red-light {
  background-color: #fef2f2;
}

.bg-blue-light {
  background-color: #e0f2fe;
}

.bg-light-gray {
  background-color: #f8fafc;
}

.bg-orange {
  background-color: var(--card-orange);
}

.bg-green {
  background-color: var(--card-green);
}

.bg-blue {
  background-color: var(--card-blue);
}

.bg-red {
  background-color: #ef4444;
}

.text-blue {
  color: var(--card-blue);
}

.text-orange {
  color: var(--card-orange);
}

.cursor-pointer {
  cursor: pointer;
}

/* Buttons */
.btn-solid-blue {
  background-color: var(--card-blue);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-solid-blue:hover {
  background-color: #2b6fe4;
}

.btn-outline-blue {
  background-color: transparent;
  color: var(--card-blue);
  border: 1px solid var(--card-blue);
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-outline-blue:hover {
  background-color: #eff6ff;
}

.btn-solid-dark {
  background-color: var(--card-orange);
  /* Sometimes orange or dark */
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
}

.btn-outline-dark {
  background-color: transparent;
  color: var(--text-dark);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 10px 20px;
  font-weight: 600;
}

/* Stepper Component */
.stepper-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 1;
}

.stepper-line {
  position: absolute;
  top: 21px;
  /* Center with 42px circle */
  left: 50px;
  right: 50px;
  height: 2px;
  background-color: #e2e8f0;
  z-index: 0;
}

.stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  padding: 0;
  width: 120px;
}

.step-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  border: 4px solid white;
  /* Essential to separate from line */
  box-shadow: 0 0 0 1px #e2e8f0;
  /* Subtle outer border */
}

.stepper-item.active .step-circle {
  background-color: var(--card-blue);
  color: white;
  box-shadow: 0 0 0 4px rgba(64, 134, 244, 0.15);
  border-color: white;
}

.stepper-item.completed .step-circle {
  background-color: var(--card-green);
  color: white;
  border-color: white;
}

.step-label {
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.stepper-item.active .step-label {
  color: var(--card-blue);
}


/* Invoice Summary Card */
.invoice-summary-card {
  background-color: white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-sm);
  padding: 30px;
  height: 100%;
}

.invoice-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 10px;
}

.invoice-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.invoice-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  margin-bottom: 15px;
  color: #334155;
}

.invoice-line-val {
  font-weight: 600;
}

.invoice-total {
  background-color: var(--card-green);
  color: white;
  border-radius: 6px;
  padding: 12px 15px;
  font-weight: 700;
  font-size: 0.95rem;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay > .modal-content-legacy {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-md);
  animation: modalIn 0.3s ease-out forwards;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Video Grid and Cards */
.video-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.video-card {
  background: white;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Real native HTML5 video player wrapper */
.video-player-wrapper {
  position: relative;
  width: 100%;
  background: #0a0a0a;
  overflow: hidden;
  /* 16:9 aspect ratio */
  aspect-ratio: 16 / 9;
}

.native-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* Placeholder for when no URL is given */
.video-placeholder {
  width: 100%;
  height: 100%;
  min-height: 180px;
  background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 3rem;
}

/* ---- Click-to-play Poster ---- */
.video-poster {
  position: absolute;
  inset: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
  overflow: hidden;
  transition: filter 0.2s ease;
}

.poster-video-bg,
.poster-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  opacity: 0.6;
  /* Sutil transparencia para que el botón resalte */
  transition: opacity 0.3s ease;
}

.video-poster:hover .poster-video-bg,
.video-poster:hover .poster-image {
  opacity: 0.8;
}


/* Subtle animated background shimmer */
.video-poster::before {
  content: '';
  position: absolute;
  inset: -50%;
  background: conic-gradient(from 0deg at 50% 50%,
      transparent 0deg,
      rgba(155, 68, 230, 0.08) 60deg,
      transparent 120deg);
  animation: posterShimmer 8s linear infinite;
}

@keyframes posterShimmer {
  to {
    transform: rotate(360deg);
  }
}

.video-poster:hover {
  filter: brightness(1.12);
}

/* Overlay for the play button area */
.video-poster-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

/* Outer pulse ring */
.vp-play-btn::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  animation: vpPulse 2s ease-out infinite;
}

@keyframes vpPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }

  70% {
    transform: scale(1.6);
    opacity: 0;
  }

  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* The actual play button circle */
.vp-play-btn {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-poster:hover .vp-play-btn {
  transform: scale(1.12);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.5);
}

.vp-play-btn i {
  font-size: 1.4rem;
  color: var(--btn-purple);
  margin-left: 4px;
  /* Visual center for triangle */
}

/* Bottom label strip */
.video-poster-label {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.3px;
}

.vp-duration-hint {
  margin-left: auto;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.5px;
}

/* When video replaces poster — smooth slide-in */
.native-video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  animation: videoFadeIn 0.4s ease forwards;
}

@keyframes videoFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.video-card-body {
  padding: 15px;
}

.video-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.video-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ---- Tutorials Page Header ---- */
.tutorials-header {
  display: flex;
  align-items: center;
  gap: 20px;
}

.tutorials-header-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--sidebar-bg-top), var(--btn-purple));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.6rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(134, 70, 237, 0.35);
}

.tutorials-title {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--text-dark);
  margin: 0 0 4px;
}

.tutorials-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ---- Recover Page Layout ---- */
.recover-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 24px;
  align-items: start;
}

.recover-video-col,
.recover-search-col {
  height: 100%;
}

/* ---- International Purchase Video Banner ---- */
.intl-video-banner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  align-items: center;
  background: white;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  padding: 0;
}

.intl-video-wrapper {
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  overflow: hidden;
}

.intl-video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.intl-video-info {
  padding: 24px;
}

.intl-video-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--sidebar-bg-top), var(--btn-purple));
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.intl-video-title {
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.intl-video-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Responsive adjustments */
/* @media (max-width: 768px) {
  .video-grid { grid-template-columns: 1fr; }
  .recover-layout { grid-template-columns: 1fr; }
  .intl-video-banner { grid-template-columns: 1fr; }
  .intl-video-info { padding: 16px; }
}
 */
/* Packages Tabs & Table */
.packages-tabs {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
}

.packages-tabs .tab {
  padding: 10px 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}

.packages-tabs .tab.active {
  color: var(--card-blue);
  border-bottom-color: var(--card-blue);
}

/* Tracking Timeline */
.tracking-timeline {
  display: flex;
  flex-direction: column;
  padding-left: 10px;
  position: relative;
}

.tracking-timeline::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 0;
  left: 17px;
  width: 2px;
  background-color: #e2e8f0;
  z-index: 1;
}

.timeline-item {
  display: flex;
  margin-bottom: 25px;
  position: relative;
  z-index: 2;
}

.timeline-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #cbd5e1;
  border: 3px solid white;
  margin-right: 20px;
  margin-top: 4px;
}

.timeline-item.active .timeline-dot {
  background-color: var(--card-blue);
  box-shadow: 0 0 0 2px var(--card-blue);
  border: 2px solid white;
}

.timeline-datetime {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.timeline-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* --- ANIMATIONS AND HOVER EFFECTS --- */
@keyframes fadeInSlideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
  }

  to {
    opacity: 1;
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.white-card,
.stat-card,
.action-card,
.ad-sidebar,
.invoice-summary-card,
.video-card {
  animation: fadeInSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
  /* Important for start state of animation */
}

/* Stagger delays for a cool entry effect */
.stat-card:nth-child(1) {
  animation-delay: 0.1s;
}

.stat-card:nth-child(2) {
  animation-delay: 0.2s;
}

.stat-card:nth-child(3) {
  animation-delay: 0.3s;
}

.action-card:nth-child(1) {
  animation-delay: 0.3s;
}

.action-card:nth-child(2) {
  animation-delay: 0.4s;
}

.action-card:nth-child(3) {
  animation-delay: 0.5s;
}

/* Interactive Hovers */
table.table-custom tbody tr {
  transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

table.table-custom tbody tr:hover {
  background-color: #f1f5f9;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  z-index: 10;
  position: relative;
}

.btn-solid-blue,
.btn-solid-dark,
.btn-outline-blue {
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.btn-solid-blue:hover,
.btn-solid-dark:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* --- RESPONSIVE DESIGN (Media Queries) --- */

/* Tablets and medium screens (1024px and below) */
@media (max-width: 1024px) {
  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }

  .action-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* --- LOGIN PAGE --- */
.auth-wrapper {
  background-color: #f6f8fb;
  background-image: radial-gradient(#e2e8f0 2px, transparent 2px);
  background-size: 25px 25px;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-container {
  width: 100%;
  margin: 0 auto;
}

.login-card {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06) !important;
}

.z-index-1 {
  z-index: 1;
}

.hover-lift {
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(64, 134, 244, 0.25) !important;
}

.hover-underline:hover {
  text-decoration: underline !important;
}

.prompt-hover:hover {
  text-decoration: underline !important;
}

@media (max-width: 992px) {
  .login-card {
    flex-direction: column;
    max-width: 500px;
    margin: 0 auto;
    min-height: auto;
  }

  .login-left {
    display: none !important;
  }

  .login-right {
    max-width: 100% !important;
    width: 100% !important;
    padding: 30px !important;
  }
}

/* --- RECOVER PAGE NEW DESIGN --- */
.recover-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: white;
  padding: 5px 5px 5px 15px;
  transition: border-color 0.2s;
}

.search-input-group:focus-within {
  border-color: var(--card-blue);
  box-shadow: 0 0 0 3px rgba(64, 134, 244, 0.1);
}

.search-input-group input {
  border: none;
  background: transparent;
  flex: 1;
  padding: 10px 0;
  font-size: 0.95rem;
  outline: none;
}

.search-input-group .search-label {
  position: absolute;
  top: -10px;
  left: 15px;
  background: white;
  padding: 0 5px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.package-item-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 20px;
}

.package-icon-box {
  width: 48px;
  height: 48px;
  background: #e2e8f0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #64748b;
}

.package-image-container {
  width: 140px;
  height: 140px;
  background: #f1f5f9;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  cursor: zoom-in;
  flex-shrink: 0;
}

.package-image-container:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1);
  border-color: var(--card-blue);
}

.package-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.package-info-main {
  flex: 1;
}

.package-info-label {
  font-size: 0.7rem;
  color: #94a3b8;
  text-transform: uppercase;
  font-weight: 700;
}

.package-info-val {
  font-weight: 600;
  font-size: 0.9rem;
}

.form-floating-custom {
  margin-bottom: 15px;
}

.form-floating-custom label {
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 5px;
  display: block;
}

.form-control-custom {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.form-control-custom:focus {
  background: white;
  border-color: var(--card-blue);
  outline: none;
}

.empty-state-img {
  max-width: 280px;
  margin-bottom: 25px;
}

.stepper-label-active {
  color: var(--card-blue) !important;
}

.stepper-label-done {
  color: var(--card-green) !important;
}

/* --- RESPONSIVE FIXES (MEDIA QUERIES) --- */

.mobile-only {
  display: none !important;
}

@media (max-width: 750px) {
  .mobile-only {
    display: block !important;
  }

  .sidebar {
    position: fixed;
    height: 100vh;
    left: calc(var(--sidebar-width) * -1);
    box-shadow: 10px 0 20px rgba(0, 0, 0, 0.1);
  }

  .sidebar.show-mobile {
    left: 0;
  }

  .main-wrapper {
    width: 100%;
  }

  .hamburger-menu {
    display: block;
  }

  .topbar {
    padding: 0 20px;
  }

  .dashboard-main-grid {
    grid-template-columns: 1fr;
  }
}



/* --- MOBILE APP UPSELL POPUP --- */
.mobile-app-upsell {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: white;
  box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.15), 0 10px 30px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  border-radius: 16px;
  padding: 24px;
  display: none;
  /* Hide on desktop by default */
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid #e2e8f0;
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.upsell-close {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 5px;
}

.upsell-icon {
  font-size: 2.5rem;
  color: var(--card-blue);
  margin-bottom: 15px;
}

.upsell-title {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 8px;
}

.upsell-text {
  font-size: 0.85rem;
  color: #64748b;
  margin-bottom: 25px;
  line-height: 1.5;
}

.upsell-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}

.upsell-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.75rem;
  transition: all 0.2s;
  background: #f8fafc;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.upsell-btn i {
  font-size: 1.2rem;
}

.upsell-btn:hover {
  background: #f1f5f9;
  transform: translateY(-2px);
}

.upsell-btn.primary-btn {
  background: var(--card-blue);
  color: white;
  border: none;
}

.upsell-btn.primary-btn:hover {
  background: #2b6fe4;
}


.text-info-box {
  background: #f1f5f9;
  padding: 15px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #475569;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Show upsell popup only on mobile */
@media (max-width: 500px) {
  .mobile-app-upsell {
    display: flex;
  }
}

/* --- MOBILE RESPONSIVE FIXES FOR RECOVER & DIRECTORY --- */
@media (max-width: 768px) {
  /* Restore Scroll for mobile layout */
  .dashboard-wrapper {
    flex-direction: column;
    overflow-y: auto !important;
  }
  .main-wrapper {
    overflow-y: visible !important;
  }
  .content-area {
    overflow-y: visible !important;
    padding: 15px !important; /* Reclaim space on mobile */
    padding-bottom: 100px !important; 
    overflow-x: hidden; /* Prevent horizontal page breaking */
  }

  /* Ensure cards fit perfectly in 2 columns without overflowing */
  .action-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  .action-card {
    padding: 20px 10px !important; 
  }

  .action-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1.1rem !important;
    margin-bottom: 10px !important;
  }

  .action-title {
    font-size: 0.8rem !important;
    margin-bottom: 5px !important;
  }

  .action-desc {
    font-size: 0.7rem !important;
    line-height: 1.2 !important;
    margin-bottom: 10px !important;
  }

  .action-btn {
    font-size: 0.75rem !important;
    padding: 6px 5px !important;
  }

  /* Stepper mobile layout */
  .stepper-container {
    padding: 0 10px;
  }
  
  .stepper-item .step-label {
    display: none; /* Hide step labels by default on mobile to save space */
  }
  
  .stepper-item.active .step-label {
    display: block; /* Show only the active step label */
    position: absolute;
    top: 45px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    text-align: center;
    font-size: 0.75rem;
    line-height: 1.3;
    white-space: normal;
  }
  
  .stepper-container > div {
    margin-bottom: 35px; /* Give room for the absolute label below */
  }
  
  .stepper-line {
    width: 85% !important;
    left: 7.5% !important;
    top: 21px !important; /* Perfect middle of the 42px circles */
  }

  .recover-card {
    padding: 24px 16px; /* Reduced horizontal padding on card for small screens */
  }
  
  .package-item-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .package-item-row > div:nth-child(n+3) {
      width: 100%;
      max-width: 100% !important;
  }
  
  .package-item-row button {
      width: 100%;
      margin-top: 5px;
  }

  .search-input-group .search-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
  }

  .stats-row {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
}

/* Prevent table text from squishing on mobile, forcing horizontal scroll */
.table-custom th, 
.table-custom td {
  white-space: nowrap;
}

/* Mapbox Geocoder full width */
.mapboxgl-ctrl-geocoder {
  min-width: 100% !important;
  max-width: 100% !important;
  box-shadow: none !important;
  border: 1px solid #ced4da;
  border-radius: 0.375rem;
}
.mapboxgl-ctrl-geocoder--input {
  background-color: #f8f9fa !important;
}

@keyframes pulse-heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.05); }
    28% { transform: scale(1); }
    42% { transform: scale(1.05); }
    70% { transform: scale(1); }
}

.btn-pulse-heartbeat {
    animation: pulse-heartbeat 2s infinite;
}

/* ─── LAPTOP / SMALL DESKTOP (1025px – 1440px) ─────────────────────────────
   En pantallas de portátil el diseño "desktop" se ve demasiado grande.
   Este breakpoint compacta sidebar, topbar, padding y tarjetas.
─────────────────────────────────────────────────────────────────────────── */
@media (min-width: 1025px) and (max-width: 1440px) {

  /* Sidebar más estrecho */
  :root {
    --sidebar-width: 195px;
  }

  .sidebar-logo {
    padding: 16px 18px;
  }

  .sidebar-logo .logo-circle {
    width: 46px;
    height: 46px;
  }

  .sidebar-link {
    padding: 8px 10px;
    font-size: 0.82rem;
    margin-bottom: 3px;
  }

  .sidebar-link i {
    font-size: 0.95rem;
    width: 20px;
    margin-right: 8px;
  }

  .sidebar-footer {
    padding: 14px 18px;
  }

  /* Topbar más delgado */
  .topbar {
    height: 58px;
    padding: 0 20px;
  }

  /* Menos relleno en el área de contenido */
  .content-area {
    padding: 16px 20px;
  }

  /* Stat cards más compactas */
  .stats-row {
    gap: 12px;
    margin-bottom: 18px;
  }

  .stat-card {
    padding: 16px 18px;
  }

  .stat-card-title {
    font-size: 0.95rem;
    margin-bottom: 5px;
  }

  .stat-card-desc {
    font-size: 0.78rem;
    margin-bottom: 10px;
  }

  .stat-badge {
    font-size: 0.7rem;
    bottom: 16px;
    right: 16px;
  }

  /* Grid principal y action grid */
  .dashboard-main-grid {
    gap: 14px;
  }

  .action-grid {
    gap: 12px;
    grid-auto-rows: minmax(155px, auto);
  }

  .action-card {
    padding: 18px 14px;
  }

  .action-icon {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    margin-bottom: 12px;
  }

  .action-title {
    font-size: 0.92rem;
    margin-bottom: 7px;
  }

  .action-desc {
    font-size: 0.75rem;
    margin-bottom: 14px;
  }

  .action-btn {
    font-size: 0.8rem;
    padding: 8px 14px;
  }

  /* Invoice card */
  .invoice-summary-card {
    padding: 20px;
  }

  .invoice-title {
    font-size: 0.95rem;
  }

  .invoice-line {
    font-size: 0.8rem;
    margin-bottom: 11px;
  }

  /* Recover card */
  .recover-card {
    padding: 24px;
  }

  /* Stepper */
  .step-circle {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .step-label {
    font-size: 0.72rem;
  }

  .stepper-line {
    top: 18px;
  }

  /* Topbar user info */
  .user-name {
    font-size: 0.82rem;
  }

  .user-client {
    font-size: 0.68rem;
  }

  .user-avatar {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }
}

/* ─────────────────────────────────────────────────────────────
   Modal Beneficios de Categorías
────────────────────────────────────────────────────────────── */
.benefits-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: fadeInModal 0.2s ease-out;
}

.benefits-modal-card {
  background: #ffffff;
  border-radius: 16px;
  max-width: 580px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  animation: scaleInModal 0.25s ease-out;
}

.benefit-tier-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.benefit-tier-card.active-tier {
  border: 2px solid #f97316;
  background: #fff7ed;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
}

.tier-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 0.85rem;
}

.tier-icon.bronze {
  background: #fed7aa;
  color: #9a3412;
}

.tier-icon.silver {
  background: #e2e8f0;
  color: #475569;
}

.tier-icon.gold {
  background: #fef08a;
  color: #a16207;
}

.tier-icon.platinum {
  background: #e0e7ff;
  color: #4338ca;
}

.benefit-list {
  list-style: none;
  margin: 8px 0 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: #475569;
}

@keyframes fadeInModal {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleInModal {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Embedded & Mobile Calculator Styling
   ========================================================================== */
.embedded-calculator-page {
  min-height: auto;
  width: 100%;
  background-color: transparent;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8px 10px;
  box-sizing: border-box;
}

@media (min-width: 768px) {
  .embedded-calculator-page {
    padding: 16px;
  }
}

.embedded-calculator-viewport {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
}

.calculator-wrapper {
  width: 100%;
  box-sizing: border-box;
}

.calculator-responsive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
}

@media (min-width: 992px) {
  .calculator-responsive-grid {
    grid-template-columns: 1.35fr 1fr;
    gap: 24px;
    align-items: start;
  }
}

.calculator-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  box-sizing: border-box;
  width: 100%;
}

@media (min-width: 768px) {
  .calculator-card {
    padding: 28px;
  }
}

.calculator-heading {
  font-size: 1.25rem;
  color: #0f172a;
  letter-spacing: -0.3px;
}

.calculator-card .form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 6px;
  display: block;
}

.form-control-calc {
  font-size: 16px !important; /* Prevents auto-zoom on iOS */
  min-height: 46px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background-color: #f8fafc;
  color: #1e293b;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.form-control-calc:focus {
  background-color: #ffffff;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
  outline: none;
}

/* Language selector pills */
.lang-switch-btn-group {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 20px;
  padding: 3px;
  border: 1px solid #e2e8f0;
}

.lang-pill {
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-pill.active {
  background: #2563eb;
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

/* Tariff dropdown enhancements */
.tariff-dropdown-list {
  max-height: 320px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e2e8f0;
  padding: 0;
  overflow: hidden;
  z-index: 1060;
}

.tariff-items-container {
  max-height: 250px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Calculate button */
.btn-calculate-shipping {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  min-height: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.btn-calculate-shipping:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
  transform: translateY(-1px);
}

.btn-calculate-shipping:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Results section */
.results-section {
  display: flex;
  flex-direction: column;
}

@media (max-width: 991px) {
  .results-section {
    margin-top: 5px;
  }
}

/* Elegant 2-line truncation for long table descriptions */
.table-desc-clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
  max-width: 320px;
  word-break: break-word;
  color: #334155;
  cursor: help;
}

.table-desc-clamp:hover {
  color: #0f172a;
}