/* ============================================
   waflow — Prototype Styles
   Design System Implementation
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --brand-50: #ECFDF5;
  --brand-100: #D1FAE5;
  --brand-400: #34D399;
  --brand-500: #10B981;
  --brand-600: #059669;
  --brand-700: #047857;

  /* Gray */
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  /* Semantic */
  --success-50: #F0FDF4;
  --success-500: #22C55E;
  --success-700: #15803D;
  --error-50: #FEF2F2;
  --error-500: #EF4444;
  --error-700: #B91C1C;
  --warning-50: #FFFBEB;
  --warning-500: #F59E0B;
  --warning-700: #B45309;
  --info-50: #EFF6FF;
  --info-500: #3B82F6;
  --info-700: #1D4ED8;

  /* Kanban */
  --stage-new: #3B82F6;
  --stage-info: #F97316;
  --stage-offer: #8B5CF6;
  --stage-negotiation: #EAB308;
  --stage-payment: #EF4444;
  --stage-paid: #22C55E;
  --stage-courier: #14B8A6;
  --stage-delivering: #6366F1;
  --stage-done: #6B7280;

  /* Layout */
  --sidebar-width: 240px;
  --topbar-height: 56px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--gray-900);
  line-height: 1.5;
  background: var(--gray-50);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-500); text-decoration: none; transition: color 0.15s; }
a:hover { color: var(--brand-600); }

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

/* --- Typography --- */
.display-lg { font-size: 3rem; font-weight: 700; line-height: 1.17; }
.display-md { font-size: 2.25rem; font-weight: 700; line-height: 1.22; }
.display-sm { font-size: 1.875rem; font-weight: 600; line-height: 1.27; }
.heading-lg { font-size: 1.5rem; font-weight: 600; line-height: 1.33; }
.heading-md { font-size: 1.25rem; font-weight: 600; line-height: 1.4; }
.heading-sm { font-size: 1rem; font-weight: 600; line-height: 1.5; }
.body-lg { font-size: 1rem; line-height: 1.5; }
.body-md { font-size: 0.875rem; line-height: 1.43; }
.body-sm { font-size: 0.75rem; line-height: 1.33; }
.mono { font-family: 'JetBrains Mono', 'SF Mono', monospace; font-size: 0.8125rem; }
.text-muted { color: var(--gray-500); }
.text-secondary { color: var(--gray-700); }

/* --- Buttons --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-weight: 600; border: none; cursor: pointer;
  border-radius: 6px; transition: all 0.15s ease-in-out; text-decoration: none;
  white-space: nowrap;
}
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-md { height: 40px; padding: 0 16px; font-size: 14px; }
.btn-lg { height: 48px; padding: 0 20px; font-size: 16px; }
.btn-primary { background: var(--brand-500); color: #fff; }
.btn-primary:hover { background: var(--brand-600); color: #fff; box-shadow: var(--shadow-sm); }
.btn-secondary { background: #fff; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); color: var(--gray-700); }
.btn-ghost { background: transparent; color: var(--gray-700); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-destructive { background: var(--error-500); color: #fff; }
.btn-destructive:hover { background: var(--error-700); color: #fff; }
.btn-outline { background: transparent; color: var(--brand-500); border: 1px solid var(--brand-500); }
.btn-outline:hover { background: var(--brand-50); color: var(--brand-600); }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; font-weight: 500; color: var(--gray-700); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; height: 40px; padding: 0 12px; font-family: inherit; font-size: 14px;
  border: 1px solid var(--gray-300); border-radius: 6px; background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s; color: var(--gray-900);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}
.form-input::placeholder { color: var(--gray-400); }
.form-textarea { height: auto; min-height: 80px; padding: 10px 12px; resize: vertical; }
.form-helper { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--error-700); margin-top: 4px; }
.form-checkbox { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.form-checkbox input { width: 18px; height: 18px; accent-color: var(--brand-500); cursor: pointer; }
.form-radio { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.form-radio input { width: 18px; height: 18px; accent-color: var(--brand-500); cursor: pointer; }
.form-divider { display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--gray-400); font-size: 13px; }
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }

/* Phone input composite */
.phone-input { display: flex; gap: 0; }
.phone-input .phone-code {
  width: 80px; height: 40px; padding: 0 8px; font-size: 14px;
  border: 1px solid var(--gray-300); border-radius: 6px 0 0 6px; border-right: none;
  background: var(--gray-50); color: var(--gray-700); font-family: inherit;
}
.phone-input .form-input { border-radius: 0 6px 6px 0; }

/* --- Cards --- */
.card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 8px;
  box-shadow: var(--shadow-md); padding: 24px;
}
.card-hover:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); transition: all 0.2s; }

/* --- Badges --- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 9999px; font-size: 12px; font-weight: 500;
}
.badge-success { background: var(--success-50); color: var(--success-700); }
.badge-error { background: var(--error-50); color: var(--error-700); }
.badge-warning { background: var(--warning-50); color: var(--warning-700); }
.badge-info { background: var(--info-50); color: var(--info-700); }
.badge-neutral { background: var(--gray-100); color: var(--gray-700); }
.badge-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 9999px;
  font-size: 11px; font-weight: 700; background: var(--error-500); color: #fff;
}

/* --- Tables --- */
.table-container { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
thead { background: var(--gray-50); }
th { padding: 12px 16px; font-size: 14px; font-weight: 500; color: var(--gray-700); text-align: left; border-bottom: 1px solid var(--gray-200); }
td { padding: 12px 16px; font-size: 14px; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }
tbody tr:hover { background: var(--gray-50); }
tbody tr:last-child td { border-bottom: none; }

/* --- Status Dots --- */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.dot-green { background: var(--success-500); }
.dot-yellow { background: var(--warning-500); }
.dot-red { background: var(--error-500); }
.dot-gray { background: var(--gray-400); }

/* --- Utilities --- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mb-8 { margin-bottom: 32px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.p-8 { padding: 32px; }
.hidden { display: none; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* ============================================
   PUBLIC WEBSITE LAYOUT
   ============================================ */

/* --- Public Navbar --- */
.pub-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 64px; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; padding: 0 32px;
}
.pub-nav-inner { display: flex; align-items: center; justify-content: space-between; width: 100%; max-width: 1200px; margin: 0 auto; }
.pub-logo { font-size: 22px; font-weight: 700; color: var(--brand-500); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.pub-logo .logo-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-500); }
.pub-nav-links { display: flex; align-items: center; gap: 32px; }
.pub-nav-links a { font-size: 14px; font-weight: 500; color: var(--gray-600); text-decoration: none; }
.pub-nav-links a:hover { color: var(--gray-900); }
.pub-nav-actions { display: flex; align-items: center; gap: 12px; }

/* --- Public Page Container --- */
.pub-page { padding-top: 64px; }
.pub-container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.pub-section { padding: 80px 0; }
.pub-section-alt { background: #fff; }

/* --- Hero --- */
.hero { padding: 100px 0 80px; text-align: center; background: linear-gradient(180deg, #fff 0%, var(--gray-50) 100%); }
.hero h1 { max-width: 800px; margin: 0 auto 16px; }
.hero .subtitle { font-size: 18px; color: var(--gray-600); max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.hero-visual {
  max-width: 960px; margin: 48px auto 0; background: var(--gray-100); border-radius: 12px;
  height: 400px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--gray-200); color: var(--gray-400); font-size: 14px;
  box-shadow: var(--shadow-xl);
}

/* --- Features Grid --- */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 32px; transition: all 0.2s;
}
.feature-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-4px); }
.feature-icon {
  width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin-bottom: 16px; background: var(--brand-50); color: var(--brand-500);
}
.feature-card h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.feature-card ul { list-style: none; padding: 0; }
.feature-card li { font-size: 14px; color: var(--gray-600); padding: 4px 0; padding-left: 20px; position: relative; }
.feature-card li::before { content: '✓'; position: absolute; left: 0; color: var(--brand-500); font-weight: 600; }

/* --- Comparison Table --- */
.comparison { display: grid; grid-template-columns: 1fr 1fr; gap: 0; max-width: 800px; margin: 0 auto; border-radius: 12px; overflow: hidden; border: 1px solid var(--gray-200); }
.comparison-col { padding: 32px; }
.comparison-bad { background: var(--error-50); }
.comparison-good { background: var(--success-50); }
.comparison-col h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }
.comparison-col li { font-size: 14px; padding: 6px 0; color: var(--gray-700); list-style: none; }

/* --- Social Proof --- */
.metrics-bar { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; max-width: 700px; margin: 0 auto; text-align: center; }
.metric-item .metric-value { font-size: 2rem; font-weight: 700; color: var(--brand-500); }
.metric-item .metric-label { font-size: 14px; color: var(--gray-600); margin-top: 4px; }

.testimonials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 48px; }
.testimonial-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; padding: 24px; }
.testimonial-quote { font-size: 14px; color: var(--gray-700); font-style: italic; margin-bottom: 16px; line-height: 1.6; }
.testimonial-author { display: flex; align-items: center; gap: 12px; }
.testimonial-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--gray-200);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--gray-600);
}
.testimonial-name { font-size: 14px; font-weight: 600; }
.testimonial-title { font-size: 12px; color: var(--gray-500); }
.testimonial-stars { color: var(--warning-500); font-size: 14px; margin-bottom: 12px; }

/* --- Screenshots --- */
.screenshots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.screenshot-block { text-align: center; }
.screenshot-mock {
  background: var(--gray-100); border: 1px solid var(--gray-200); border-radius: 12px;
  height: 240px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px; color: var(--gray-400); font-size: 13px;
}
.screenshot-block p { font-size: 14px; color: var(--gray-600); font-weight: 500; }

/* --- Use Cases --- */
.use-cases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.use-case-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 32px; text-align: center; transition: all 0.2s;
}
.use-case-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.use-case-icon { font-size: 40px; margin-bottom: 12px; }
.use-case-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.use-case-card p { font-size: 14px; color: var(--gray-600); }

/* --- Footer --- */
.pub-footer { background: var(--gray-900); color: var(--gray-400); padding: 64px 0 32px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px; margin-bottom: 48px; }
.footer-brand .pub-logo { color: #fff; margin-bottom: 12px; }
.footer-brand p { font-size: 14px; color: var(--gray-400); line-height: 1.6; }
.footer-col h4 { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 16px; }
.footer-col a { display: block; font-size: 14px; color: var(--gray-400); padding: 4px 0; text-decoration: none; }
.footer-col a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid var(--gray-800); padding-top: 24px; display: flex; justify-content: space-between; align-items: center; font-size: 13px; }

/* --- CTA Section --- */
.cta-section { text-align: center; background: var(--brand-500); padding: 80px 0; color: #fff; }
.cta-section h2 { color: #fff; margin-bottom: 12px; }
.cta-section p { color: rgba(255,255,255,0.8); margin-bottom: 24px; font-size: 16px; }
.cta-section .btn-primary { background: #fff; color: var(--brand-600); }
.cta-section .btn-primary:hover { background: var(--gray-50); }
.cta-section .btn-outline { border-color: rgba(255,255,255,0.5); color: #fff; }
.cta-section .btn-outline:hover { background: rgba(255,255,255,0.1); }

/* ============================================
   PRICING PAGE
   ============================================ */
.billing-toggle { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 48px; }
.billing-toggle span { font-size: 14px; font-weight: 500; color: var(--gray-500); }
.billing-toggle span.active { color: var(--gray-900); }
.toggle-switch {
  width: 44px; height: 24px; background: var(--gray-300); border-radius: 12px;
  position: relative; cursor: pointer;
}
.toggle-switch::after {
  content: ''; position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px; background: #fff; border-radius: 50%;
  transition: transform 0.15s;
}

.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; max-width: 1000px; margin: 0 auto; }
.pricing-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  padding: 32px; position: relative;
}
.pricing-card.featured { border-color: var(--brand-500); box-shadow: 0 0 0 1px var(--brand-500); }
.pricing-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--brand-500); color: #fff; font-size: 12px; font-weight: 600;
  padding: 4px 12px; border-radius: 9999px;
}
.pricing-card h3 { font-size: 20px; font-weight: 600; margin-bottom: 4px; }
.pricing-price { font-size: 36px; font-weight: 700; margin: 16px 0; }
.pricing-price span { font-size: 14px; font-weight: 400; color: var(--gray-500); }
.pricing-features { list-style: none; padding: 0; margin: 24px 0; }
.pricing-features li { font-size: 14px; padding: 6px 0; color: var(--gray-600); display: flex; align-items: center; gap: 8px; }
.pricing-features .check { color: var(--brand-500); font-weight: 700; }
.pricing-features .cross { color: var(--gray-400); }

/* --- FAQ --- */
.faq-list { max-width: 700px; margin: 0 auto; }
.faq-item { border-bottom: 1px solid var(--gray-200); padding: 20px 0; }
.faq-q { font-size: 16px; font-weight: 600; color: var(--gray-900); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.faq-a { font-size: 14px; color: var(--gray-600); margin-top: 8px; line-height: 1.6; }

/* ============================================
   HOW IT WORKS
   ============================================ */
.steps { max-width: 700px; margin: 0 auto; position: relative; }
.steps::before {
  content: ''; position: absolute; left: 24px; top: 0; bottom: 0;
  width: 2px; background: var(--gray-200);
}
.step-item { display: flex; gap: 24px; margin-bottom: 48px; position: relative; }
.step-number {
  width: 48px; height: 48px; min-width: 48px; border-radius: 50%;
  background: var(--brand-500); color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; z-index: 1;
}
.step-content h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.step-content p { font-size: 14px; color: var(--gray-600); line-height: 1.6; }

/* ============================================
   AUTH PAGES
   ============================================ */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--gray-50); padding: 32px;
}
.auth-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: var(--shadow-xl); padding: 40px; width: 100%; max-width: 440px;
}
.auth-logo { text-align: center; margin-bottom: 32px; }
.auth-logo a { font-size: 24px; font-weight: 700; color: var(--brand-500); text-decoration: none; }
.auth-title { font-size: 20px; font-weight: 600; margin-bottom: 8px; text-align: center; }
.auth-subtitle { font-size: 14px; color: var(--gray-500); margin-bottom: 24px; text-align: center; }
.auth-footer { margin-top: 24px; text-align: center; font-size: 14px; color: var(--gray-500); }
.auth-social { display: flex; gap: 12px; margin-top: 16px; }
.auth-social .btn { flex: 1; }

/* ============================================
   ONBOARDING
   ============================================ */
.onboarding-page { min-height: 100vh; background: var(--gray-50); }
.onboarding-header {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: 16px 32px; display: flex; align-items: center; justify-content: space-between;
}
.onboarding-progress { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gray-500); }
.progress-bar { width: 200px; height: 6px; background: var(--gray-200); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--brand-500); border-radius: 3px; transition: width 0.3s; }
.onboarding-content { max-width: 600px; margin: 48px auto; padding: 0 32px; }
.onboarding-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 40px; }
.onboarding-actions { display: flex; justify-content: space-between; margin-top: 32px; }
.onboarding-checklist { list-style: none; padding: 0; }
.onboarding-checklist li { padding: 8px 0; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.onboarding-checklist .check-icon { color: var(--brand-500); font-weight: 700; }

/* ============================================
   APP LAYOUT
   ============================================ */
.app-layout { min-height: 100vh; }

/* Topbar */
.app-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: var(--topbar-height); background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.app-topbar-left { display: flex; align-items: center; gap: 16px; }
.app-topbar-logo { font-size: 18px; font-weight: 700; color: var(--brand-500); text-decoration: none; display: flex; align-items: center; gap: 6px; }
.workspace-select {
  display: flex; align-items: center; gap: 6px; padding: 6px 12px;
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 6px;
  font-size: 14px; font-weight: 500; color: var(--gray-700); cursor: pointer;
}
.app-topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-notif {
  position: relative; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; cursor: pointer; font-size: 18px;
}
.topbar-notif:hover { background: var(--gray-100); }
.topbar-notif .badge-count { position: absolute; top: 2px; right: 2px; font-size: 10px; min-width: 16px; height: 16px; }
.topbar-user {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
}
.topbar-user:hover { background: var(--gray-100); }
.topbar-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--brand-100); color: var(--brand-700);
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.topbar-user-name { font-size: 14px; font-weight: 500; color: var(--gray-700); }

/* Trial Banner */
.trial-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  height: 36px; background: var(--info-500); color: #fff;
  display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 13px; font-weight: 500;
}
.trial-banner .btn { height: 24px; font-size: 12px; padding: 0 10px; background: #fff; color: var(--info-700); border: none; }
.has-trial .app-topbar { top: 36px; }
.has-trial .app-sidebar { top: calc(36px + var(--topbar-height)); }
.has-trial .app-main { padding-top: calc(36px + var(--topbar-height)); }

/* Sidebar */
.app-sidebar {
  position: fixed; top: var(--topbar-height); left: 0; bottom: 0;
  width: var(--sidebar-width); background: #fff; border-right: 1px solid var(--gray-200);
  overflow-y: auto; z-index: 100; padding: 8px 0;
}
.sidebar-section { padding: 4px 8px; }
.sidebar-divider { height: 1px; background: var(--gray-200); margin: 8px 12px; }
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; margin: 2px 0; border-radius: 6px;
  font-size: 14px; font-weight: 500; color: var(--gray-500); text-decoration: none;
  transition: all 0.15s; position: relative;
}
.sidebar-item:hover { background: var(--gray-100); color: var(--gray-700); }
.sidebar-item.active { background: var(--brand-50); color: var(--brand-700); }
.sidebar-icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-badge { margin-left: auto; }

/* Main Content */
.app-main {
  margin-left: var(--sidebar-width); padding-top: var(--topbar-height);
  min-height: 100vh;
}
.app-content { padding: 24px; }
.app-page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.app-page-title { font-size: 24px; font-weight: 600; }

/* --- Dashboard Specific --- */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; padding: 20px; }
.kpi-label { font-size: 13px; color: var(--gray-500); font-weight: 500; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.kpi-trend { font-size: 13px; font-weight: 500; margin-top: 4px; }
.kpi-trend.up { color: var(--success-500); }
.kpi-trend.down { color: var(--error-500); }

.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.dashboard-card { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; }
.dashboard-card-header { padding: 16px 20px; border-bottom: 1px solid var(--gray-100); display: flex; justify-content: space-between; align-items: center; }
.dashboard-card-header h3 { font-size: 15px; font-weight: 600; }
.dashboard-card-body { padding: 16px 20px; }

.chart-placeholder {
  background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: 8px;
  height: 200px; display: flex; align-items: center; justify-content: center;
  color: var(--gray-400); font-size: 14px;
}
.chart-placeholder-lg { height: 280px; }

/* Mini kanban summary */
.mini-kanban { display: flex; flex-wrap: wrap; gap: 8px; }
.mini-kanban-item { padding: 6px 10px; background: var(--gray-50); border-radius: 6px; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mini-kanban-count { font-weight: 700; font-size: 18px; }
.mini-kanban-label { color: var(--gray-500); font-size: 11px; }

/* Urgent items */
.urgent-list { list-style: none; padding: 0; }
.urgent-item { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--gray-100); }
.urgent-item:last-child { border-bottom: none; }
.urgent-dot { min-width: 6px; height: 6px; border-radius: 50%; background: var(--error-500); }

/* Recent items */
.recent-item { padding: 10px 0; border-bottom: 1px solid var(--gray-100); }
.recent-item:last-child { border-bottom: none; }
.recent-item-name { font-size: 14px; font-weight: 500; }
.recent-item-detail { font-size: 13px; color: var(--gray-500); margin-top: 2px; }

/* --- Chats Layout --- */
.chats-layout { display: grid; grid-template-columns: 280px 1fr 320px; height: calc(100vh - var(--topbar-height)); margin: 0 -24px -24px; }
.chats-sidebar { border-right: 1px solid var(--gray-200); background: #fff; display: flex; flex-direction: column; overflow: hidden; }
.chats-sidebar-header { padding: 16px; border-bottom: 1px solid var(--gray-200); }
.chats-search { position: relative; }
.chats-search .form-input { padding-left: 36px; height: 36px; font-size: 13px; }
.chats-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 14px; }
.chats-filters { padding: 8px 16px; display: flex; gap: 6px; flex-wrap: wrap; }
.chat-filter-chip {
  padding: 4px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500;
  background: var(--gray-100); color: var(--gray-600); cursor: pointer;
  border: 1px solid transparent;
}
.chat-filter-chip.active { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200, var(--brand-400)); }
.chats-list { flex: 1; overflow-y: auto; }
.chat-item {
  display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
  cursor: pointer; transition: background 0.15s;
}
.chat-item:hover { background: var(--gray-50); }
.chat-item.active { background: var(--brand-50); }
.chat-item.unread { background: var(--gray-50); }
.chat-item-avatar {
  width: 40px; height: 40px; min-width: 40px; border-radius: 50%; background: var(--gray-200);
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: var(--gray-600);
  position: relative;
}
.chat-item-avatar .dot { position: absolute; bottom: 0; right: 0; width: 10px; height: 10px; border: 2px solid #fff; }
.chat-item-body { flex: 1; min-width: 0; }
.chat-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2px; }
.chat-item-name { font-size: 14px; font-weight: 500; }
.chat-item-name.unread { font-weight: 700; }
.chat-item-time { font-size: 11px; color: var(--gray-400); }
.chat-item-preview { font-size: 13px; color: var(--gray-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item-meta { display: flex; align-items: center; gap: 6px; margin-top: 4px; }

/* Chat window */
.chat-window { display: flex; flex-direction: column; background: var(--gray-50); }
.chat-window-header {
  padding: 12px 20px; background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.chat-window-client { display: flex; align-items: center; gap: 12px; }
.chat-window-client-name { font-size: 15px; font-weight: 600; }
.chat-window-client-phone { font-size: 13px; color: var(--gray-500); }
.chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { max-width: 70%; padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.5; }
.chat-msg-in { background: #fff; border: 1px solid var(--gray-200); align-self: flex-start; border-bottom-left-radius: 4px; }
.chat-msg-out { background: var(--brand-500); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.chat-msg-system { background: transparent; align-self: center; color: var(--gray-500); font-size: 12px; text-align: center; padding: 4px 0; }
.chat-msg-time { font-size: 11px; margin-top: 4px; opacity: 0.7; }
.chat-input-area { padding: 12px 20px; background: #fff; border-top: 1px solid var(--gray-200); }
.chat-quick-actions { display: flex; gap: 6px; margin-bottom: 10px; }
.chat-quick-actions .btn { font-size: 12px; height: 28px; padding: 0 10px; }
.chat-input-row { display: flex; gap: 8px; }
.chat-input-row .form-input { height: 40px; flex: 1; }

/* Chat context panel */
.chat-context { background: #fff; border-left: 1px solid var(--gray-200); overflow-y: auto; padding: 20px; }
.context-section { margin-bottom: 20px; }
.context-section-title { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--gray-400); letter-spacing: 0.5px; margin-bottom: 10px; }
.context-field { margin-bottom: 8px; }
.context-label { font-size: 12px; color: var(--gray-500); }
.context-value { font-size: 14px; font-weight: 500; }
.context-divider { height: 1px; background: var(--gray-200); margin: 16px 0; }

/* --- Kanban --- */
.kanban-wrapper { overflow-x: auto; margin: 0 -24px; padding: 0 24px 24px; }
.kanban-board { display: flex; gap: 12px; min-width: max-content; }
.kanban-column { width: 220px; min-width: 220px; background: var(--gray-50); border-radius: 8px; display: flex; flex-direction: column; max-height: calc(100vh - var(--topbar-height) - 120px); }
.kanban-column-header {
  padding: 10px 12px; font-size: 13px; font-weight: 600; color: var(--gray-700);
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--gray-300); position: sticky; top: 0; background: var(--gray-50); border-radius: 8px 8px 0 0;
}
.kanban-column-count { font-size: 12px; font-weight: 500; color: var(--gray-400); }
.kanban-cards { padding: 8px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kanban-card {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 6px;
  padding: 12px; cursor: grab; transition: all 0.2s; border-left: 3px solid;
}
.kanban-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kanban-card-name { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.kanban-card-phone { font-size: 12px; color: var(--gray-500); font-family: 'JetBrains Mono', monospace; margin-bottom: 6px; }
.kanban-card-info { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.kanban-card-amount { font-weight: 600; }
.kanban-card-city { color: var(--gray-500); font-size: 12px; }
.kanban-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--gray-100); }
.kanban-card-tag { font-size: 11px; padding: 2px 6px; border-radius: 4px; background: var(--gray-100); color: var(--gray-600); }

/* --- Analytics --- */
.analytics-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--gray-200); margin-bottom: 24px; }
.analytics-tab {
  padding: 12px 20px; font-size: 14px; font-weight: 500; color: var(--gray-500);
  text-decoration: none; border-bottom: 2px solid transparent; transition: all 0.15s;
}
.analytics-tab:hover { color: var(--gray-700); }
.analytics-tab.active { color: var(--brand-500); border-bottom-color: var(--brand-500); }

.funnel { max-width: 400px; }
.funnel-step { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.funnel-bar { height: 28px; background: var(--brand-100); border-radius: 4px; display: flex; align-items: center; padding: 0 10px; font-size: 12px; font-weight: 600; color: var(--brand-700); min-width: 40px; }
.funnel-label { font-size: 13px; color: var(--gray-600); }
.funnel-arrow { text-align: center; color: var(--gray-400); font-size: 12px; padding: 2px 0 2px 24px; }

/* --- Settings Layout --- */
.settings-layout { display: grid; grid-template-columns: 200px 1fr; gap: 24px; }
.settings-nav { }
.settings-nav-item {
  display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px;
  color: var(--gray-600); text-decoration: none; margin-bottom: 2px;
}
.settings-nav-item:hover { background: var(--gray-100); color: var(--gray-700); }
.settings-nav-item.active { background: var(--brand-50); color: var(--brand-700); font-weight: 500; }
.settings-panel { background: #fff; border: 1px solid var(--gray-200); border-radius: 8px; padding: 32px; }
.settings-section { margin-bottom: 32px; }
.settings-section:last-child { margin-bottom: 0; }
.settings-section-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-100); }

/* --- Billing --- */
.plan-card { background: var(--brand-50); border: 1px solid var(--brand-400); border-radius: 8px; padding: 24px; margin-bottom: 24px; }
.usage-bar { margin-bottom: 12px; }
.usage-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.usage-track { height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden; }
.usage-fill { height: 100%; border-radius: 4px; transition: width 0.3s; }
.usage-fill.ok { background: var(--brand-500); }
.usage-fill.warning { background: var(--warning-500); }
.usage-fill.danger { background: var(--error-500); }

/* --- Finances tabs --- */
.finance-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--gray-200); margin-bottom: 24px; }
.finance-tab {
  padding: 12px 20px; font-size: 14px; font-weight: 500; color: var(--gray-500);
  text-decoration: none; border-bottom: 2px solid transparent;
}
.finance-tab:hover { color: var(--gray-700); }
.finance-tab.active { color: var(--brand-500); border-bottom-color: var(--brand-500); }
.finance-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.finance-summary-card { padding: 16px; background: var(--gray-50); border-radius: 8px; }
.finance-summary-label { font-size: 13px; color: var(--gray-500); margin-bottom: 4px; }
.finance-summary-value { font-size: 20px; font-weight: 700; }

/* --- Empty State --- */
.empty-state { text-align: center; padding: 64px 32px; }
.empty-state-icon { font-size: 48px; color: var(--gray-300); margin-bottom: 16px; }
.empty-state h3 { font-size: 20px; font-weight: 600; margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--gray-500); max-width: 400px; margin: 0 auto 24px; }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 16px 0; font-size: 14px; color: var(--gray-500); }
.pagination .btn { min-width: 32px; }

/* --- Responsive placeholder --- */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: 1fr; max-width: 400px; }
  .testimonials { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
