/* ==========================================================================
   Negavia (نگاویا) — Modern SaaS Design System (Fluid Intelligence)
   Strictly tokenized according to AGENTS.md Brand Guidelines
   ========================================================================== */

@import url('https://cdn.jsdelivr.net/gh/rastikerdar/vazirmatn@v33.003/Vazirmatn-font-face.css');

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--surface-bg);
  color: var(--text-primary);
  font-family: Vazirmatn, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: var(--brand-glow-radial);
  background-attachment: fixed;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
}

a {
  color: var(--brand-primary);
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
  text-decoration: none;
  opacity: 0.88;
}

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

.container {
  width: 100%;
  max-width: 1220px;
  margin-inline: auto;
  padding-inline: 20px;
}

/* ==========================================================================
   Topbar / Header
   ========================================================================== */
.topbar {
  background: var(--surface-topbar);
  color: var(--surface-topbar-text);
  border-bottom: 1px solid var(--surface-glass-border);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 50;
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-logo {
  height: 38px;
  width: auto;
  transition: transform var(--transition-bounce), filter var(--transition-smooth);
}

.brand-link:hover .brand-logo {
  transform: scale(1.02);
  filter: drop-shadow(0 2px 10px rgba(100, 40, 245, 0.35));
}

.brand-version-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft-primary);
  color: var(--brand-primary);
  border: 1px solid var(--border-card-glow);
  direction: ltr;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  color: var(--text-secondary);
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--surface-soft-primary);
}

.nav-link.is-active {
  color: var(--brand-primary);
  background: var(--surface-soft-primary);
  font-weight: 700;
}

.nav-link-accent {
  color: var(--brand-primary);
  border: 1px dashed var(--border-card-glow);
}

/* User pill in topbar */
.user-menu-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.user-avatar-sm {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(100, 40, 245, 0.3);
}

/* Mobile drawer toggle */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px;
  cursor: pointer;
  color: var(--text-primary);
}

@media (max-width: 820px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: 72px;
    right: 0;
    left: 0;
    background: var(--surface-card);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 20px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.is-open {
    display: flex;
  }
  .nav-link {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
  }
}

/* ==========================================================================
   Buttons & Interactive Elements
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.94rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-primary);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-glow-primary);
}

.btn-primary:hover {
  background: #541ee0;
  box-shadow: 0 10px 28px -4px rgba(100, 40, 245, 0.55);
  transform: translateY(-1px);
  color: #FFFFFF;
}

.btn-hero {
  background: var(--brand-gradient);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-glow-primary);
  border: none;
  font-weight: 700;
}

.btn-hero:hover {
  background: var(--brand-gradient-hover);
  box-shadow: 0 12px 32px -4px rgba(100, 40, 245, 0.6);
  transform: translateY(-2px);
  color: #FFFFFF;
}

.btn-secondary {
  background: var(--surface-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--surface-alt);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

.btn-outline {
  background: transparent;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-outline:hover {
  background: var(--surface-soft-primary);
  color: var(--brand-primary);
}

.btn-danger {
  background: var(--status-error);
  color: var(--text-on-primary);
}

.btn-danger:hover {
  background: #b91c1c;
  color: #FFFFFF;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.84rem;
  border-radius: var(--radius-xs);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Cards, Grid & Layouts
   ========================================================================== */
.page-main {
  flex: 1;
  padding-block: 32px 64px;
}

.card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-smooth);
  position: relative;
}

.card-interactive:hover {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--border-card-glow);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.card-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ==========================================================================
   Hero Section (Landing / Sales)
   ========================================================================== */
.hero-section {
  text-align: center;
  padding: 48px 20px 36px;
  position: relative;
  max-width: 900px;
  margin-inline: auto;
}

.badge-live-pulse {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--surface-soft-primary);
  color: var(--brand-primary);
  border: 1px solid var(--border-card-glow);
  font-size: 0.86rem;
  font-weight: 700;
  margin-bottom: 18px;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-secondary);
  box-shadow: 0 0 10px var(--brand-secondary);
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.4);
    opacity: 1;
    box-shadow: 0 0 14px var(--brand-secondary);
  }
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(1.8rem, 4vw, 2.85rem);
  font-weight: 900;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.hero-desc {
  margin: 0 auto 30px;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.85;
  color: var(--text-secondary);
  max-width: 720px;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

/* Interactive Pipeline Visualizer (Mockup) */
.pipeline-showcase {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-lg);
  margin-block: 24px 56px;
  position: relative;
  overflow: hidden;
}

.pipeline-nodes {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

@media (max-width: 768px) {
  .pipeline-nodes {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .pipeline-connector {
    transform: rotate(90deg);
  }
}

.pipeline-node {
  background: var(--surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  position: relative;
  transition: all var(--transition-smooth);
}

.pipeline-node:hover {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.pipeline-node-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.pipeline-connector {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-secondary);
}

.pipeline-connector svg {
  animation: floatArrow 2s infinite ease-in-out;
}

@keyframes floatArrow {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-6px); }
}

/* ==========================================================================
   Pricing Section & Switcher
   ========================================================================== */
.pricing-header {
  text-align: center;
  margin-bottom: 36px;
}

.cycle-switcher-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
  margin-top: 18px;
}

.cycle-btn {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.cycle-btn.is-active {
  background: var(--brand-primary);
  color: var(--text-on-primary);
  box-shadow: var(--shadow-glow-primary);
}

.discount-tag {
  font-size: 0.76rem;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--status-success-bg);
  color: var(--status-success-text);
  font-weight: 800;
}

/* Plan Cards */
.plan-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: var(--radius-lg);
  position: relative;
  padding: 28px 24px;
}

.plan-card.is-featured {
  border: 2px solid var(--brand-primary);
  box-shadow: var(--shadow-card-hover), 0 0 24px rgba(100, 40, 245, 0.18);
  background: linear-gradient(180deg, var(--surface-card) 0%, rgba(100, 40, 245, 0.03) 100%);
  transform: scale(1.02);
}

@media (max-width: 980px) {
  .plan-card.is-featured {
    transform: none;
  }
}

.plan-badge-top {
  position: absolute;
  top: -14px;
  right: 50%;
  transform: translateX(50%);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-size: 0.78rem;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(100, 40, 245, 0.4);
}

.plan-price-wrap {
  margin: 18px 0 14px;
}

.plan-price-val {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--brand-primary);
  letter-spacing: -0.02em;
}

.plan-price-sub {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.plan-feature-list {
  list-style: none;
  padding: 0;
  margin: 18px 0 24px;
  display: grid;
  gap: 12px;
  font-size: 0.92rem;
}

.plan-feature-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.plan-feature-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--brand-secondary);
}

/* ==========================================================================
   Dashboard Shell & Sidebar
   ========================================================================== */
.dash-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

@media (max-width: 890px) {
  .dash-layout {
    grid-template-columns: 1fr;
  }
}

.sidebar-card {
  padding: 16px;
  position: sticky;
  top: 96px;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.94rem;
  transition: all var(--transition-fast);
}

.sidebar-nav-item:hover {
  background: var(--surface-soft-primary);
  color: var(--brand-primary);
}

.sidebar-nav-item.is-active {
  background: var(--surface-soft-primary);
  color: var(--brand-primary);
  font-weight: 700;
  border-right: 3px solid var(--brand-primary);
}

.sidebar-icon-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-quota-box {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

/* Progress bar */
.progress-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  transition: width var(--transition-smooth);
}

/* Dashboard Metric Stats Card */
.stat-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-smooth);
}

.stat-card:hover {
  border-color: var(--border-card-glow);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card-info {
  display: grid;
  gap: 4px;
}

.stat-card-title {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card-value {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--surface-soft-primary);
  color: var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ==========================================================================
   Forms, Inputs & Segmented Controls
   ========================================================================== */
.form-stack {
  display: grid;
  gap: 16px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.input,
.select,
.textarea {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-input);
  background: var(--surface-card);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.94rem;
  transition: all var(--transition-fast);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--surface-focus-ring);
}

.ltr {
  direction: ltr;
  text-align: left;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Segmented Tabs */
.tabs-segmented {
  display: flex;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: var(--radius-pill);
  gap: 4px;
  margin-bottom: 20px;
}

.tab-btn-seg {
  flex: 1;
  padding: 9px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.tab-btn-seg.is-active {
  background: var(--surface-card);
  color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Tables & Data Presentation
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface-card);
}

.table th,
.table td {
  padding: 13px 16px;
  text-align: right;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-subtle);
}

.table th {
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 0.86rem;
  white-space: nowrap;
}

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

.table tr:hover td {
  background: var(--surface-alt);
}

/* ==========================================================================
   Alerts & Badges
   ========================================================================== */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.92rem;
  border: 1px solid transparent;
}

.alert-success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
  border-color: var(--status-success);
}

.alert-error {
  background: var(--status-error-bg);
  color: var(--status-error-text);
  border-color: var(--status-error);
}

.alert-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
  border-color: var(--status-warning);
}

.alert-info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
  border-color: var(--status-info);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.3;
}

.badge-brand {
  background: var(--surface-soft-primary);
  color: var(--brand-primary);
  border: 1px solid var(--border-card-glow);
}

.badge-secondary {
  background: var(--surface-soft-secondary);
  color: #078c9f;
  border: 1px solid rgba(8, 199, 232, 0.3);
}

.badge-success {
  background: var(--status-success-bg);
  color: var(--status-success-text);
}

.badge-warning {
  background: var(--status-warning-bg);
  color: var(--status-warning-text);
}

.badge-error {
  background: var(--status-error-bg);
  color: var(--status-error-text);
}

.badge-info {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
  background: var(--surface-card);
  border-top: 1px solid var(--border-subtle);
  padding-block: 28px;
  margin-top: auto;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.system-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--status-success-bg);
  color: var(--status-success-text);
  font-size: 0.8rem;
  font-weight: 700;
}

.system-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-success);
  box-shadow: 0 0 6px var(--status-success);
}
