/* Botech Professional Design System */

/* Color Palette - SEO Mode Inspired */
:root {
  /* Brand Colors - Purple Theme */
  --primary: #3E5879;
  --secondary: #E84545;
  --accent: #FFD700;
  
  /* Neutral Colors */
  --bg: #ffffff;
  --bg-alt: #f8f7fa;
  --bg-card: #ffffff;
  --text: #212529;
  --text-muted: #6c757d;
  --text-light: #adb5bd;
  --border: #e2e8f0;
  --border-light: #f7fafc;
  
  /* Interactive States */
  --primary-hover: #213555;
  --primary-light: #e0d9f7; 
  --secondary-hover: #d63320;
  --secondary-light: #fef2f2;
  --accent-hover: #e6c200;
  --accent-light: #fff9e6;
  
  /* Purple variations for gradients */
  --purple-light: #E8D9FF;
  --purple-lighter: #f5f0ff;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
}

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

html { 
  height: 100%; 
  scroll-behavior: smooth;
}

body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a { 
  color: inherit; 
  text-decoration: none; 
  transition: all 0.2s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin-bottom: var(--space-sm);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.25rem; }
h3 { font-size: 1.875rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1.125rem; }

p { margin-bottom: var(--space-md); }

.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }

/* Layout */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container.small { max-width: 768px; }
.container.large { max-width: 1400px; }

/* Grid System */
.grid {
  display: grid;
  gap: var(--space-lg);
}

.grid.cols-1 { grid-template-columns: 1fr; }
.grid.cols-2 { grid-template-columns: repeat(1, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(1, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(1, 1fr); }

@media (min-width: 640px) {
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Dashboard Grid Overrides - Equal width columns */
.dash-main .grid.cols-2 {
  grid-template-columns: repeat(1, 1fr);
  gap: var(--space-xl);
}

@media (min-width: 1024px) {
  .dash-main .grid.cols-2 {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  height: 72px;
  width: 100%;
  padding: 0 var(--space-lg);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
}

.logo-img {
  height: 50px;
  width: auto;
  display: block;
  max-width: 100%;
}

@media (max-width: 640px) {
  .logo-img {
    height: 45px;
  }
}

.nav-links { 
  display: none; 
  gap: var(--space-xl); 
  align-items: center;
}

.nav-links a { 
  color: var(--text-muted); 
  font-weight: 500;
  padding: var(--space-sm) 0;
  position: relative;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active { 
  color: var(--text); 
  font-weight: 600;
}

.nav-links a.active::after {
  display: none;
}

.nav-cta { 
  display: flex; 
  gap: var(--space-sm); 
  align-items: center;
}

/* Profile Dropdown */
.profile-dropdown {
  position: relative;
}

.profile-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-btn:hover {
  transform: scale(1.05);
}

.profile-btn:focus {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  transition: border-color 0.2s ease;
}

.profile-btn:hover .profile-avatar {
  border-color: var(--primary);
}

.profile-avatar-fallback {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  border: 2px solid var(--border);
  transition: border-color 0.2s ease;
}

.profile-btn:hover .profile-avatar-fallback {
  border-color: var(--primary);
}

.profile-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
  overflow: hidden;
}

.profile-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
}

.profile-dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.profile-dropdown-avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
}

.profile-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.profile-dropdown-info strong {
  font-weight: 600;
  color: var(--text);
  font-size: 0.9375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-info span {
  font-size: 0.875rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 0;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.2s ease;
  font-size: 0.9375rem;
  font-weight: 500;
}

.profile-dropdown-item:hover {
  background: var(--bg-alt);
}

.profile-dropdown-item svg {
  flex-shrink: 0;
  color: var(--text-muted);
}

.profile-dropdown-item:hover svg {
  color: var(--text);
}

.profile-dropdown-item span {
  flex: 1;
}

@media (min-width: 768px) {
  .nav-links { display: flex; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.btn:hover { 
  background: var(--primary-hover); 
  transform: translateY(-1px); 
  box-shadow: var(--shadow);
}

.btn:active { 
  transform: translateY(0); 
  box-shadow: var(--shadow);
}

.btn.secondary {
  background: var(--secondary);
  border-color: var(--secondary);
}

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

.btn.accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text);
}

.btn.accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn.ghost { 
  background: transparent; 
  color: var(--primary); 
  border: 2px solid var(--border);
  box-shadow: none;
}

.btn.ghost:hover { 
  background: var(--primary-light); 
  border-color: var(--primary);
}

.btn.outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.outline:hover {
  background: var(--bg-alt);
  border-color: var(--border);
  color: var(--text);
}

.btn.danger { 
  background: var(--secondary); 
  border-color: var(--secondary);
}

.btn.danger:hover {
  background: var(--secondary-hover);
  border-color: var(--secondary-hover);
}

.btn.large {
  padding: var(--space-md) var(--space-xl);
  font-size: 1rem;
}

.btn.small {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.875rem;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: var(--space-xl);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow);
}

.card.highlight {
  border: 2px solid var(--primary);
  position: relative;
}

.card.highlight::before {
  content: 'Popular';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--text);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius);
  font-size: 0.75rem;
  font-weight: 600;
}

/* Hero Section */
.hero {
  padding: var(--space-3xl) 0;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23134686' fill-opacity='0.03'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  z-index: -1;
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: 50px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
  margin-bottom: var(--space-lg);
  border: none;
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-lg);
  color: var(--text);
}

.hero .lead {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: var(--space-2xl);
  max-width: 600px;
  line-height: 1.6;
}

.hero .actions { 
  display: flex; 
  gap: var(--space-md); 
  flex-wrap: wrap; 
  align-items: center;
}

/* Feature Cards */
.feature {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.feature-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--primary-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
}

.feature-icon.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

.feature h3 { 
  margin-bottom: var(--space-sm); 
  font-size: 1.25rem; 
  color: var(--text);
}

.feature p { 
  margin: 0; 
  color: var(--text-muted); 
  line-height: 1.6;
}

/* Pricing */
.pricing { 
  padding: var(--space-3xl) 0; 
  background: var(--bg-alt);
}

.plan {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  height: 100%;
}

.plan h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.price { 
  font-size: 2.5rem; 
  font-weight: 800; 
  color: var(--text);
  line-height: 1;
}

.price small { 
  font-weight: 500; 
  color: var(--text-muted); 
  font-size: 1rem; 
}

.plan ul { 
  margin: 0; 
  padding: 0; 
  list-style: none;
  flex-grow: 1;
}

.plan li {
  padding: var(--space-sm) 0;
  color: var(--text-muted);
  position: relative;
  padding-left: var(--space-lg);
}

.plan li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* Forms */
form { margin: 0; }

.form-row { 
  display: grid; 
  gap: var(--space-lg); 
  margin-bottom: var(--space-lg);
}

@media (min-width: 768px) {
  .form-row { grid-template-columns: repeat(2, 1fr); }
}

label { 
  font-weight: 600; 
  display: block; 
  margin-bottom: var(--space-sm); 
  color: var(--text);
}

input[type="text"], 
input[type="email"], 
input[type="password"],
input[type="tel"],
input[type="url"],
select,
textarea {
  width: 100%;
  padding: var(--space-md);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 1rem;
  transition: all 0.2s ease;
  font-family: inherit;
}

input:focus, 
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(19, 70, 134, 0.1);
}

textarea { 
  min-height: 120px; 
  resize: vertical; 
  line-height: 1.6;
}

input[type="file"] {
  padding: var(--space-sm);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  cursor: pointer;
}

/* Sections */
section { 
  padding: var(--space-3xl) 0; 
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}

.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: var(--space-md);
  color: var(--text);
}

.section-header p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Footer */
.footer { 
  padding: var(--space-2xl) 0; 
  border-top: 1px solid var(--border); 
  background: var(--bg-alt); 
}

.footer p { 
  color: var(--text-muted); 
  margin: 0; 
  text-align: center; 
}

/* Dashboard Layout */
.dash { 
  display: grid; 
  grid-template-columns: 1fr; 
  min-height: calc(100vh - 72px);
}

.dash-sidebar {
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  padding: var(--space-lg);
  position: relative;
}

.dash-burger { 
  position: absolute; 
  right: var(--space-lg); 
  top: var(--space-lg); 
  cursor: pointer; 
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  background: var(--bg);
  font-size: 1.25rem;
  transition: all 0.2s ease;
}

.dash-burger:hover {
  background: var(--primary-light);
  border-color: var(--primary);
}

.dash-sidebar #sidebar-toggle { display: none; }

.dash-user { 
  display: flex; 
  align-items: center; 
  gap: var(--space-md); 
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
}

.avatar { 
  width: 48px; 
  height: 48px; 
  border-radius: 50%; 
  display: flex; 
  align-items: center; 
  justify-content: center; 
}

.avatar img {
  width: 48px;
  height: auto;
  border-radius: 50%;
}

.avatar-fallback {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.user-meta { 
  color: var(--text-muted); 
  font-size: 0.875rem; 
}

.user-meta strong { 
  color: var(--text); 
  display: block; 
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

/* Document Usage Progress Bar */
.usage-progress-container {
  position: relative;
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  background: var(--bg-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  cursor: help;
}

.usage-progress-container:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: var(--text);
  color: var(--bg);
  font-size: 0.75rem;
  border-radius: var(--radius);
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
  box-shadow: var(--shadow-md);
}

.usage-progress-container:hover::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: -4px;
  border: 4px solid transparent;
  border-top-color: var(--text);
  z-index: 1001;
  pointer-events: none;
}

.usage-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.usage-progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.usage-progress-percentage {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--primary);
}

.usage-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
}

.usage-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 9999px;
  transition: width 0.3s ease;
  position: relative;
}

.usage-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.usage-progress-footer {
  display: flex;
  justify-content: center;
}

.usage-progress-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dash-nav { 
  display: flex;
  flex-direction: column;
  gap: var(--space-xs); 
}

.dash-nav a { 
  padding: var(--space-md); 
  border-radius: var(--radius); 
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all 0.2s ease;
}

.dash-nav a:hover { 
  background: var(--primary-light); 
  color: var(--primary); 
}

.dash-nav a.active { 
  background: var(--primary); 
  color: white; 
}

.dash-nav a.active:hover {
  background: var(--primary-hover);
}

.dash-main { 
  padding: var(--space-xl); 
  background: var(--bg-alt);
  width: 100%;
  overflow-x: auto;
}

/* Dashboard specific container overrides */
.dash-main .container { 
  max-width: none !important; 
  padding: 0 !important;
  width: 100% !important;
}

.dash-main section { 
  padding: 0 !important;
  width: 100%;
}

.dash-main section > div {
  width: 100%;
  max-width: 100%;
  padding: 0;
}

.dash-main section .container { 
  max-width: none !important; 
  padding: 0 !important; 
  width: 100% !important;
}

/* IMPORTANT: Do not override explicit grid column classes inside dashboard.
   Pages use .grid.cols-2 / .grid.cols-3 to control layout. */

/* Ensure dashboard content uses full width */
.dash-main > *,
.dash-main section > *,
.dash-main section > div > * {
  width: 100%;
}

.dash-main .card,
.dash-main .grid {
  width: 100%;
}

/* Override any container constraints in dashboard */
.dash .container,
.dash section .container,
.dash section > div {
  max-width: none !important;
  width: 100% !important;
  padding: 0 !important;
}

@media (min-width: 1024px) {
  .dash { 
    grid-template-columns: 280px 1fr; 
  }
  .dash-burger { display: none; }
}

/* Sidebar collapse on mobile */
@media (max-width: 1023px) {
  .dash-sidebar { 
    position: sticky; 
    top: 72px; 
    z-index: 10; 
  }
  .dash-nav { display: none; }
  #sidebar-toggle:checked ~ .dash-nav { 
    display: flex; 
    margin-top: var(--space-lg); 
  }
}

/* Utilities */
.center { text-align: center; }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.muted { color: var(--text-muted); }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.font-bold { font-weight: 700; }

.spacer { height: var(--space-lg); }
.spacer-sm { height: var(--space-sm); }
.spacer-lg { height: var(--space-xl); }
.spacer-xl { height: var(--space-2xl); }

.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-0 { margin-top: 0; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

/* Responsive Design */
@media (max-width: 640px) {
  .container { padding: 0 var(--space-md); }
  .hero { padding: var(--space-2xl) 0; }
  .hero h1 { font-size: 2.5rem; }
  .hero .lead { font-size: 1.125rem; }
  .hero .actions { flex-direction: column; width: 100%; }
  .hero .actions .btn { width: 100%; justify-content: center; }
  
  .nav-cta { flex-direction: row; gap: var(--space-xs); }
  .nav-cta .btn { font-size: 0.875rem; padding: var(--space-xs) var(--space-md); }
  
  .profile-dropdown-menu {
    right: 0;
    min-width: 260px;
  }
  
  section { padding: var(--space-2xl) 0; }
  .card { padding: var(--space-lg); }
  
  .form-row { grid-template-columns: 1fr; }
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* Focus styles for accessibility */
.btn:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .nav, .footer, .dash-sidebar { display: none; }
  .dash-main { padding: 0; }
  * { box-shadow: none !important; }
}

/* ----------------------------------------- */
/* Global Alerts                             */
/* ----------------------------------------- */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.alert-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.alert-warning {
  background: #fffbeb;
  color: #92400e;
  border: 1px solid #fde68a;
}

/* ----------------------------------------- */
/* Icon Buttons & Small Controls             */
/* ----------------------------------------- */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn-icon:hover {
  background: var(--bg-alt);
  border-color: var(--primary);
}

.btn-danger:hover {
  background: #fee2e2;
  border-color: #fecaca;
}

/* ----------------------------------------- */
/* Knowledge List (Dashboard)                */
/* ----------------------------------------- */
.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.knowledge-item {
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.knowledge-item.inactive {
  opacity: 0.6;
  background: var(--bg-alt);
}

.knowledge-item:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}

.knowledge-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.knowledge-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-inactive {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.625rem;
  font-weight: 500;
  color: var(--text-muted);
}

.knowledge-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.knowledge-actions {
  display: flex;
  gap: 0.5rem;
}

.knowledge-preview {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.empty-state {
  text-align: center;
  padding: 2rem;
}

/* ----------------------------------------- */
/* Stats Row (Dashboard cards)               */
/* ----------------------------------------- */
.stats-row {
  display: flex;
  gap: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-alt);
  border-radius: var(--radius);
}

.stat-item { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  gap: var(--space-xs); 
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.stat-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ----------------------------------------- */
/* Utilities & Helpers                       */
/* ----------------------------------------- */
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.sticky { position: sticky; }
.top-lg { top: var(--space-lg); }
.font-mono { font-family: 'Monaco', 'Menlo', 'Courier New', monospace; }
.space-y-sm > * + * { margin-top: var(--space-sm); }
.space-y-md > * + * { margin-top: var(--space-md); }
.py-xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.chatbots-list { display: flex; flex-direction: column; gap: var(--space-lg); }

/* Responsive tweaks for stats row */
@media (max-width: 768px) {
  .stats-row { flex-direction: column; gap: var(--space-sm); }
}