/**
 * Global UI scale: 20% smaller (80% size). Zoom on content wrappers only —
 * not html — so position:fixed (feedback FAB) stays pinned while scrolling.
 */
body.saas-page-app > .wrap,
body.saas-page-dashboard > .wrap {
  zoom: 0.8;
}

body.saas-page-login .auth-container {
  zoom: 0.8;
}

body.saas-page-home > .page {
  zoom: 0.8;
}

@supports not (zoom: 0.8) {
  body.saas-page-app > .wrap,
  body.saas-page-dashboard > .wrap,
  body.saas-page-login .auth-container,
  body.saas-page-home > .page {
    zoom: unset;
    transform: scale(0.8);
    transform-origin: top center;
  }
}

/* Room for fixed blue feedback button (bottom-left) */
body.saas-page-app,
body.saas-page-dashboard {
  padding-bottom: 72px;
}

/* Viewport-locked layer — never inside zoomed .wrap; FAB at bottom-left */
#saasFabPortal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 2147483000 !important;
  pointer-events: none !important;
  overflow: visible !important;
  zoom: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: flex-end !important;
  align-items: flex-start !important;
  padding: 0 0 max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)) !important;
}
#saasFabPortal #saasFeedbackFab {
  pointer-events: auto !important;
  position: relative !important;
}

/* Never show a second floating feedback control on the right edge */
body.saas-page-login .saas-fb-fab,
body.saas-page-login #saasFeedbackFab {
  display: none !important;
}

/* ═══════════════════════════════════════════════════════════════ */
/* Dashboard Sidebar Layout Styles */
/* ═══════════════════════════════════════════════════════════════ */

body.saas-page-app {
  margin: 0;
  padding: 0;
  overflow: hidden; /* Prevent body scroll, layout handles it */
}

/* Hide the old wrap completely when using the new layout */
body.saas-page-app > .wrap.legacy-layout {
  display: none;
}

.dashboard-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  background: transparent;
  position: relative;
  z-index: 10;
}

.dashboard-sidebar {
  width: 260px;
  background: rgba(11, 15, 25, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--teal), var(--blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 12px;
}

.nav-group {
  margin-bottom: 24px;
}

.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  margin: 0 0 8px 12px;
  font-weight: 700;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 4px;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: rgba(0, 229, 160, 0.1);
  color: var(--teal);
  border-left: 3px solid var(--teal);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(0,0,0,0.2);
}

.dashboard-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.dashboard-topbar {
  height: 70px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(6, 11, 24, 0.6);
  backdrop-filter: blur(10px);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.views-container {
  flex: 1;
  overflow-y: auto;
  padding: 30px;
}

.dashboard-view {
  display: none;
  animation: fadeIn 0.3s ease;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 60px;
}

.dashboard-view.active-view {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Redesigning standard cards for Dashboard context */
.dashboard-view .card {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.dashboard-view .feature-card {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.view-header {
  margin-bottom: 24px;
}

.view-header h1 {
  font-size: 28px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.view-header p {
  color: var(--text-secondary);
  font-size: 15px;
}

/* Home Overview Grid */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.stat-title {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-sub {
  font-size: 12px;
  color: var(--teal);
  margin-top: 4px;
}
