/* ============================================================
   SAAS.CSS — Modern SaaS Design Framework
   Inspired by Linear, Vercel, and Stripe Dashboard
   ============================================================ */

/* === RESET & BASE === */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* === CUSTOM PROPERTIES === */
:root {
  /* Light mode (default) */
  --bg: #ffffff;
  --bg-card: #f8fafc;
  --bg-elevated: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-glow: rgba(37, 99, 235, 0.35);
  --primary-soft: rgba(37, 99, 235, 0.1);

  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --info: #0891b2;

  --gradient-1: #2563eb;
  --gradient-2: #7c3aed;
  --gradient-3: #db2777;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1), 0 4px 8px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 4px var(--primary-glow);

  --font-mono: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, monospace;
  --transition: 0.2s ease;

  --nav-height: 64px;
  --max-width: 1200px;
  --content-pad: 1.5rem;
}

[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-elevated: #151c2c;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --border-strong: #475569;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-glow: rgba(59, 130, 246, 0.45);
  --primary-soft: rgba(59, 130, 246, 0.15);

  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --info: #22d3ee;

  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6), 0 4px 8px rgba(0, 0, 0, 0.4);
}

/* === UTILITIES === */
.gradient-text {
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--gradient-3));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.gradient-bg {
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-pad);
}

.text-muted {
  color: var(--text-muted);
}

/* === NAV === */
.saas-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: background-color var(--transition), border-color var(--transition);
}

.saas-nav .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.saas-nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
}

.saas-nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  list-style: none;
}

.saas-nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color var(--transition);
}

.saas-nav-links a:hover,
.saas-nav-links a.active {
  color: var(--text);
  position: relative;
}
.saas-nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}
/* dropdown trigger active keeps same color; menu links no underline */
.saas-nav-links .dropdown-menu a.active::after { display: none; }

/* ---- Dropdown menu (hover to reveal Tools sub-pages) ---- */
.saas-nav-links .dropdown {
  position: relative;
}
.saas-nav-links .dropdown > a::after {
  content: "▾";
  margin-left: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
}
.saas-nav-links .dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: var(--bg-elevated, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  list-style: none;
  z-index: 100;
}
.saas-nav-links .dropdown:hover > .dropdown-menu,
.saas-nav-links .dropdown:focus-within > .dropdown-menu {
  display: flex;
}
.saas-nav-links .dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  white-space: nowrap;
}
.saas-nav-links .dropdown-menu a:hover,
.saas-nav-links .dropdown-menu a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.saas-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 768px) {
  .saas-nav-links {
    display: none;
  }
}

/* === HERO === */
.saas-hero {
  position: relative;
  padding: 6rem 1.5rem 5rem;
  text-align: center;
  overflow: hidden;
}

.saas-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 50% at 50% 0%, var(--primary-soft), transparent 70%),
    radial-gradient(40% 40% at 80% 20%, rgba(124, 58, 237, 0.12), transparent 70%),
    radial-gradient(40% 40% at 20% 30%, rgba(219, 39, 119, 0.1), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.saas-hero > * {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.saas-hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1.25rem;
}

.saas-hero p {
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.saas-hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* === FEATURES === */
.saas-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 4rem var(--content-pad);
  max-width: var(--max-width);
  margin: 0 auto;
}

.saas-feature-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.saas-feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.saas-feature-card .icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 1rem;
}

.saas-feature-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.saas-feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* === PRICING === */
.saas-pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 4rem var(--content-pad);
  max-width: var(--max-width);
  margin: 0 auto;
}

.saas-pricing-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  transition: transform var(--transition), box-shadow var(--transition);
}

.saas-pricing-card.featured {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
  position: relative;
}

.saas-pricing-card.featured::before {
  content: "Most Popular";
  position: absolute;
  top: -0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.saas-pricing-card .tier-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.saas-pricing-card .price {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.saas-pricing-card .price span {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-muted);
}

.saas-pricing-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.saas-pricing-card li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.saas-pricing-card li::before {
  content: "\2713";
  color: var(--success);
  font-weight: 700;
}

/* === DASHBOARD === */
.saas-dashboard {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - var(--nav-height));
  background: var(--bg-card);
}

.saas-sidebar {
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.saas-sidebar a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}

.saas-sidebar a:hover,
.saas-sidebar a.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.saas-main {
  padding: 2rem;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .saas-dashboard {
    grid-template-columns: 1fr;
  }
  .saas-sidebar {
    display: none;
  }
}

/* === BADGE === */
.saas-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid transparent;
  transition: all var(--transition);
}

.saas-badge.success { background: rgba(22, 163, 74, 0.12); color: var(--success); }
.saas-badge.warning { background: rgba(217, 119, 6, 0.12); color: var(--warning); }
.saas-badge.danger { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.saas-badge.info { background: rgba(8, 145, 178, 0.12); color: var(--info); }

.saas-badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* === TABS === */
.saas-tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.saas-tab {
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  font-family: inherit;
}

.saas-tab:hover {
  color: var(--text);
}

.saas-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* === TABLE === */
.saas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.saas-table thead {
  background: var(--bg-elevated);
}

.saas-table th {
  text-align: left;
  padding: 0.875rem 1rem;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.saas-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.saas-table tbody tr:last-child td {
  border-bottom: none;
}

.saas-table tbody tr {
  transition: background var(--transition);
}

.saas-table tbody tr:hover {
  background: var(--primary-soft);
}

/* === BUTTON === */
.saas-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}

.saas-btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-glow);
}

.saas-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 2px var(--primary-glow);
}

.saas-btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.saas-btn-secondary {
  background: var(--bg-elevated);
  color: var(--text);
  border-color: var(--border);
}

.saas-btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.saas-btn-ghost {
  background: transparent;
  color: var(--text-muted);
}

.saas-btn-ghost:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

.saas-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.saas-btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.saas-btn-lg { padding: 0.875rem 1.5rem; font-size: 1rem; }

/* === INPUT === */
.saas-input,
.saas-select {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.saas-input::placeholder {
  color: var(--text-muted);
}

.saas-input:focus,
.saas-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.saas-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.saas-input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

/* === SELECT === */
.saas-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.25rem;
  cursor: pointer;
}

/* === CARD === */
.saas-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.saas-card-hover:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.saas-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.saas-card-title {
  font-size: 1rem;
  font-weight: 600;
}

/* === STAT === */
.saas-stat {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saas-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.saas-stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.saas-stat-delta {
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.saas-stat-delta.up { color: var(--success); }
.saas-stat-delta.down { color: var(--danger); }

/* === SKELETON === */
.saas-skeleton {
  background: linear-gradient(
    90deg,
    var(--bg-card) 0%,
    var(--border) 50%,
    var(--bg-card) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.saas-skeleton-line {
  height: 1rem;
  margin-bottom: 0.5rem;
}

.saas-skeleton-line:last-child {
  width: 60%;
}

/* === TOAST === */
.saas-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  padding: 1rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  max-width: 400px;
  animation: slideUp 0.3s ease;
}

.saas-toast.success { border-left: 3px solid var(--success); }
.saas-toast.warning { border-left: 3px solid var(--warning); }
.saas-toast.danger { border-left: 3px solid var(--danger); }
.saas-toast.info { border-left: 3px solid var(--info); }

.saas-toast-content {
  flex: 1;
  font-size: 0.9rem;
}

.saas-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.25rem;
  line-height: 1;
}

@media (max-width: 768px) {
  .saas-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    min-width: auto;
  }
}

/* === FAQ === */
.saas-faq {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  margin-bottom: 0.75rem;
  overflow: hidden;
}

.saas-faq summary {
  padding: 1rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background var(--transition);
}

.saas-faq summary::-webkit-details-marker { display: none; }

.saas-faq summary::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform var(--transition);
}

.saas-faq[open] summary::after {
  transform: rotate(45deg);
}

.saas-faq summary:hover {
  background: var(--primary-soft);
}

.saas-faq-content {
  padding: 0 1.25rem 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* === FOOTER === */
.saas-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 4rem var(--content-pad) 2rem;
  margin-top: 4rem;
}

.saas-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  justify-items: stretch;
  align-items: start;
}

.saas-footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.75rem;
  max-width: 280px;
}

.saas-footer-col h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.saas-footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.saas-footer-col a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.saas-footer-col a:hover {
  color: var(--text);
}

.saas-footer-bottom {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 768px) {
  .saas-footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 480px) {
  .saas-footer-grid {
    grid-template-columns: 1fr;
  }
}

/* === AI CHAT === */
.saas-ai-chat {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  width: 360px;
  max-height: 560px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

.saas-ai-chat-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}

.saas-ai-chat-header .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
}

.saas-ai-chat-header h4 {
  font-size: 0.95rem;
  font-weight: 600;
}

.saas-ai-chat-header .status {
  font-size: 0.75rem;
  color: var(--success);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.saas-ai-chat-header .status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
}

.saas-ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.saas-ai-msg {
  max-width: 80%;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.5;
}

.saas-ai-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
}

.saas-ai-msg.bot {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.saas-ai-chat-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.875rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.saas-ai-chat-input input {
  flex: 1;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 0.5rem 1rem;
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
}

.saas-ai-chat-input input:focus {
  outline: none;
  border-color: var(--primary);
}

@media (max-width: 768px) {
  .saas-ai-chat {
    width: calc(100vw - 2rem);
    right: 1rem;
    bottom: 1rem;
  }
}

/* === BILLING TABLE === */
.saas-billing-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.saas-billing-table th,
.saas-billing-table td {
  padding: 1.25rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.saas-billing-table th:first-child,
.saas-billing-table td:first-child {
  text-align: left;
  border-right: 1px solid var(--border);
  background: var(--bg-elevated);
}

.saas-billing-table thead th {
  font-weight: 700;
  font-size: 1.05rem;
}

.saas-billing-table thead th.recommended {
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.saas-billing-table .plan-header {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.saas-billing-table .plan-header .price {
  font-size: 1.5rem;
  font-weight: 700;
}

.saas-billing-table .feature-yes {
  color: var(--success);
  font-weight: 700;
  font-size: 1.1rem;
}

.saas-billing-table .feature-no {
  color: var(--text-muted);
  font-size: 1.1rem;
}

@media (max-width: 768px) {
  .saas-billing-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* === USAGE BAR === */
.saas-usage-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.saas-usage-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.saas-usage-bar-fill.warning { background: var(--warning); }
.saas-usage-bar-fill.danger { background: var(--danger); }

.saas-usage-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.saas-usage-bar-label .value {
  color: var(--text);
  font-weight: 600;
}

/* === ANIMATIONS === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.animate-fadeIn { animation: fadeIn 0.4s ease both; }
.animate-slideUp { animation: slideUp 0.4s ease both; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* === SCROLLBAR === */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--radius-full);
  border: 2px solid var(--bg);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: var(--bg);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-color: var(--bg);
}

/* === RESPONSIVE BREAKPOINTS === */
@media (max-width: 1024px) {
  :root {
    --content-pad: 1rem;
  }
  .saas-features,
  .saas-pricing {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .saas-hero {
    padding: 4rem 1.25rem 3rem;
  }
  .saas-features,
  .saas-pricing {
    grid-template-columns: 1fr;
    padding: 2rem var(--content-pad);
  }
  .saas-main {
    padding: 1.25rem;
  }
  .saas-table,
  .saas-billing-table {
    display: block;
    overflow-x: auto;
  }
}

/* === THEME TOGGLE ICONS === */
#themeToggle .theme-icon-moon,
#themeToggle .theme-icon-sun {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#themeToggle svg {
  display: block;
  vertical-align: middle;
}

.saas-nav-actions .lang-switcher{display:inline-flex;align-items:center;gap:4px;margin-right:12px}
.saas-nav-actions .lang-switcher .lang-btn{display:inline-flex;align-items:center;justify-content:center;padding:6px 8px;border-radius:8px;font-size:0.8rem;font-weight:600;color:var(--text-muted,#64748b);text-decoration:none;transition:all .15s}
.saas-nav-actions .lang-switcher .lang-btn:hover{color:var(--text,#0f172a);background:rgba(100,116,139,.12)}
.saas-nav-actions .lang-switcher .lang-btn.active{color:#fff;background:#2563eb}
