/* ============================================================
   VGO PORTAL — REDESIGN LAYER
   Loaded LAST. The "warm, soft, premium-light" pass:
   floating glass nav, hero banner, display type, softer pills.
   Token values (colors/fonts/radii) live in portal.css :root.
   ============================================================ */

/* ============================================
   DISPLAY TYPE — Gabarito on headings & hero numbers
   ============================================ */
.section-title,
.block-title,
.sidebar-logo,
.login-logo,
.login-title,
.vgo-modal-title,
.billing-plan-name,
.stat-value,
.insight-value,
.billing-amount,
.analytics-stat-value,
.info-card-value {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

/* block titles get a small red dash — color rhythm through every page */
.block-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.block-title::before {
  content: '';
  width: 17px;
  height: 5px;
  border-radius: 3px;
  background: var(--banner-grad);
  flex: none;
}

/* tabular figures so numbers/dates line up in tables & stats */
.data-row,
.stat-value,
.billing-amount,
.analytics-stat-value,
.info-card-value,
.analytics-row-count,
.source-pct {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   FLOATING GLASS SIDEBAR  (iOS-style, detached)
   ============================================ */
.sidebar {
  top: 16px;
  left: 16px;
  bottom: 16px;
  height: auto;
  background: var(--bg-secondary);                              /* fallback */
  background: color-mix(in srgb, var(--bg-secondary) 80%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid var(--border);
  border-right: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.portal-main {
  margin-left: calc(var(--sidebar-width) + 32px);
}

/* red gradient cap — the sidebar header is a mini version of the banner */
.sidebar-top {
  position: relative;
  background:
    radial-gradient(130% 160% at 100% -15%, rgba(255, 255, 255, 0.22), transparent 55%),
    var(--banner-grad);
  border-bottom: none;
}
.sidebar-top::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.26) 1px, transparent 1px);
  background-size: 12px 12px;
  -webkit-mask-image: linear-gradient(80deg, transparent 32%, #000 92%);
  mask-image: linear-gradient(80deg, transparent 32%, #000 92%);
  pointer-events: none;
}
.sidebar-top > * { position: relative; z-index: 1; }
.sidebar-top .sidebar-logo { color: #fff; }
.sidebar-top .sidebar-label {
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.35);
}
.sidebar-top .theme-toggle {
  color: rgba(255, 255, 255, 0.92);
  border-color: rgba(255, 255, 255, 0.35);
}
.sidebar-top .theme-toggle:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.6);
}

/* nav links: red-tinted hover, gradient active pill (no hairline bar) */
.sidebar-link { border-radius: var(--radius-sm); }
.sidebar-link:hover {
  background: var(--accent-muted);
  color: var(--text-primary);
}
.sidebar-link.active {
  background: var(--banner-grad);
  color: #fff;
  box-shadow: 0 5px 14px rgba(220, 38, 38, 0.28);
}
.sidebar-link.active svg { stroke: #fff; }
.sidebar-link.active::before { display: none; }

/* avatar joins the red family */
.sidebar-avatar { border-radius: 13px; background: var(--banner-grad); }

/* ============================================
   BOTTOM ACCENT BAR — slim red strip across the whole page
   ============================================ */
.portal-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 8px;
  background: var(--banner-grad);
  z-index: 95;
  pointer-events: none;
}

/* ============================================
   SOFTER, BIGGER PILLS / BADGES / CONTROLS
   ============================================ */
.status-badge,
.request-type-badge {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.34rem 0.72rem;
  border-radius: 999px;
  text-transform: capitalize;
}

.filter-pill {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  text-transform: capitalize;
}
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 6px 16px var(--accent-glow);
}

.status-select {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  padding: 0.42rem 1.9rem 0.42rem 0.85rem;
  border-radius: 999px;
}

/* table: roomier rows, slightly larger header labels */
.data-row {
  font-size: 0.95rem;
  padding: 1.05rem 1.5rem;
}
.data-header span {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* tracked micro-labels: keep them small but legible & friendly */
.info-card-label,
.stat-label,
.billing-card-label,
.analytics-stat-label,
.changelog-month-label,
.analytics-table-header {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.09em;
}

/* buttons read as soft pills */
.portal-btn { border-radius: 999px; padding: 0.85rem 1.7rem; font-weight: 700; }

/* ============================================
   LEADS — trash (Recently Deleted) + NEW standout
   ============================================ */

/* NEW leads pop: solid blue badge w/ glow + pulsing dot */
.status-badge.status-new {
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(59, 130, 246, 0.45);
}
.status-badge.status-new::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  margin-right: 0.4rem;
  animation: leadNewPulse 1.6s ease-in-out infinite;
}
@keyframes leadNewPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}
.data-row.lead-new {
  box-shadow: inset 3px 0 0 var(--blue);
  background-image: linear-gradient(90deg, var(--blue-muted), transparent 45%);
}
.data-row.lead-new > span:first-child {
  font-weight: 700;
  color: var(--text-primary);
}

/* "Recently Deleted" toggle — right end of the filter pill row */
.filter-pills { align-items: center; }
.trash-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.trash-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }
.trash-count {
  background: var(--accent);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.35rem;
}

/* per-row trash icon */
.row-trash-btn {
  justify-self: end;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  border-radius: 9px;
  color: var(--text-muted);
  cursor: pointer;
  opacity: 0.55;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.data-row:hover .row-trash-btn { opacity: 1; }
.row-trash-btn:hover { color: var(--accent); background: var(--accent-muted); }

/* trash modal */
.trash-note { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.trash-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 55vh;
  overflow-y: auto;
}
.trash-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.75rem 0.95rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.trash-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.trash-row-main strong { font-size: 0.92rem; }
.trash-row-main span {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.trash-days {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
}
.trash-days-soon { color: var(--yellow); background: var(--yellow-muted); border-color: transparent; }
.trash-actions { display: flex; gap: 0.4rem; }
.trash-act-btn {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.trash-act-restore:hover { color: var(--green); border-color: var(--green); background: var(--green-muted); }
.trash-act-forever:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-muted); }
.trash-empty {
  text-align: center;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.trash-empty p { font-weight: 600; }
.trash-empty span { font-size: 0.8rem; color: var(--text-muted); }

@media (max-width: 768px) {
  .row-trash-btn { display: none; } /* mobile: delete from the lead detail page instead */
  .trash-toggle { margin-left: 0; }
  .trash-row { flex-wrap: wrap; }
  .trash-actions { width: 100%; justify-content: flex-end; }
}

/* ============================================
   MOBILE — floating bottom tab bar (iOS dock)
   ============================================ */
.mobile-tabbar { display: none; }

@media (max-width: 768px) {
  /* drawer keeps the floating-glass look when opened; closed state must
     clear its own 12px offset + shadow or a sliver peeks into the viewport */
  .sidebar {
    top: 12px;
    bottom: 12px;
    left: 12px;
    transform: translateX(calc(-100% - 60px));
  }
  .portal-main {
    margin-left: 0;
    padding-bottom: 104px; /* clear the dock */
  }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 14px;
    width: min(460px, calc(100% - 24px));
    align-items: center;
    justify-content: space-around;
    gap: 0.15rem;
    padding: 0.5rem 0.55rem;
    background: var(--bg-secondary);
    background: color-mix(in srgb, var(--bg-secondary) 82%, transparent);
    -webkit-backdrop-filter: blur(22px) saturate(1.6);
    backdrop-filter: blur(22px) saturate(1.6);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    z-index: 120;
  }
  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.4rem 0.15rem;
    border-radius: 16px;
    transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
  }
  .mobile-tab svg { width: 21px; height: 21px; }
  .mobile-tab.active {
    background: var(--banner-grad);
    color: #fff;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.30);
  }
  .mobile-tab.active svg { stroke: #fff; }

  /* mobile top header matches the nav cap */
  .portal-mobile-header {
    background:
      radial-gradient(120% 170% at 100% -20%, rgba(255, 255, 255, 0.20), transparent 55%),
      var(--banner-grad);
    border-bottom: none;
  }
  .portal-mobile-header .sidebar-logo { color: #fff; }
  .portal-mobile-header .theme-toggle {
    color: rgba(255, 255, 255, 0.92);
    border-color: rgba(255, 255, 255, 0.35);
  }
  .mobile-menu-btn { color: #fff; }

}
