/* ==========================================================================
   AajTak Email Marketing Platform — Premium Dashboard UI
   Inspired by Stripe / Linear / Vercel aesthetics
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties — Light Theme (default)
   -------------------------------------------------------------------------- */
:root,
[data-theme="light"] {
  /* Brand */
  --brand-primary: #6366f1;
  --brand-primary-hover: #4f46e5;
  --brand-primary-light: rgba(99, 102, 241, 0.12);
  --brand-secondary: #8b5cf6;
  --brand-accent: #06b6d4;
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #06b6d4 100%);
  --brand-gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.06) 100%);

  /* Semantic */
  --color-success: #10b981;
  --color-success-bg: rgba(16, 185, 129, 0.1);
  --color-warning: #f59e0b;
  --color-warning-bg: rgba(245, 158, 11, 0.1);
  --color-danger: #ef4444;
  --color-danger-bg: rgba(239, 68, 68, 0.1);
  --color-info: #3b82f6;
  --color-info-bg: rgba(59, 130, 246, 0.1);

  /* Surfaces */
  --bg-body: #f8fafc;
  --bg-body-gradient: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.08), transparent),
                      radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.05), transparent);
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-elevated: #ffffff;
  --bg-sidebar: rgba(255, 255, 255, 0.85);
  --bg-navbar: rgba(255, 255, 255, 0.72);
  --bg-input: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-overlay: rgba(15, 23, 42, 0.45);

  /* Text */
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #6366f1;

  /* Borders */
  --border-color: rgba(148, 163, 184, 0.25);
  --border-color-strong: rgba(148, 163, 184, 0.4);
  --border-focus: rgba(99, 102, 241, 0.5);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  --shadow-glow: 0 0 0 1px rgba(99, 102, 241, 0.1), 0 4px 16px rgba(99, 102, 241, 0.15);
  --shadow-card: 0 0 0 1px var(--border-color), var(--shadow-sm);

  /* Glass */
  --glass-blur: blur(16px);
  --glass-border: 1px solid rgba(255, 255, 255, 0.6);

  /* Layout */
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 72px;
  --navbar-height: 64px;
  --content-max-width: 1440px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1rem;
  --text-xl: 1.125rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

  /* Chart colors */
  --chart-1: #6366f1;
  --chart-2: #8b5cf6;
  --chart-3: #06b6d4;
  --chart-4: #10b981;
  --chart-5: #f59e0b;
}

/* --------------------------------------------------------------------------
   Dark Theme
   -------------------------------------------------------------------------- */
[data-theme="dark"] {
  --brand-primary: #818cf8;
  --brand-primary-hover: #6366f1;
  --brand-primary-light: rgba(129, 140, 248, 0.15);
  --brand-gradient: linear-gradient(135deg, #6366f1 0%, #a78bfa 50%, #22d3ee 100%);
  --brand-gradient-subtle: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(167, 139, 250, 0.08) 100%);

  --color-success-bg: rgba(16, 185, 129, 0.15);
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger-bg: rgba(239, 68, 68, 0.15);
  --color-info-bg: rgba(59, 130, 246, 0.15);

  --bg-body: #0b0f1a;
  --bg-body-gradient: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.15), transparent),
                      radial-gradient(ellipse 60% 40% at 100% 0%, rgba(139, 92, 246, 0.1), transparent);
  --bg-surface: #111827;
  --bg-surface-hover: #1e293b;
  --bg-elevated: #1a2234;
  --bg-sidebar: rgba(17, 24, 39, 0.92);
  --bg-navbar: rgba(17, 24, 39, 0.78);
  --bg-input: #1e293b;
  --bg-muted: #1e293b;
  --bg-overlay: rgba(0, 0, 0, 0.65);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-link: #818cf8;

  --border-color: rgba(148, 163, 184, 0.12);
  --border-color-strong: rgba(148, 163, 184, 0.22);
  --border-focus: rgba(129, 140, 248, 0.5);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.35), 0 4px 6px -4px rgba(0, 0, 0, 0.25);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 0 1px rgba(129, 140, 248, 0.15), 0 4px 20px rgba(99, 102, 241, 0.25);
  --shadow-card: 0 0 0 1px var(--border-color), var(--shadow-sm);

  --glass-border: 1px solid rgba(255, 255, 255, 0.06);
}

/* --------------------------------------------------------------------------
   Base & Reset Overrides
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-body);
  background-image: var(--bg-body-gradient);
  background-attachment: fixed;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-top: 0;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-primary-hover);
}

::selection {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   App Shell Layout
   -------------------------------------------------------------------------- */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  transition: margin-left var(--transition-base);
  display: flex;
  flex-direction: column;
}

.app-wrapper.sidebar-collapsed .app-main {
  margin-left: var(--sidebar-collapsed-width);
}

.app-content {
  flex: 1;
  padding: calc(var(--navbar-height) + 24px) 24px 24px;
  max-width: var(--content-max-width);
  width: 100%;
  margin: 0 auto;
}

.page-header {
  margin-bottom: 28px;
  animation: fadeInUp 0.4s ease-out;
}

.page-header h1 {
  margin-bottom: 4px;
}

.page-header .breadcrumb {
  margin-bottom: 0;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-base);
  margin: 0;
}

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */
.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-right: var(--glass-border);
  border-right-color: var(--border-color);
  z-index: 1040;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.app-wrapper.sidebar-collapsed .app-sidebar {
  width: var(--sidebar-collapsed-width);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border-color);
  min-height: 72px;
}

.sidebar-brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow);
}

.sidebar-brand-text {
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  transition: opacity var(--transition-fast);
}

.app-wrapper.sidebar-collapsed .sidebar-brand-text {
  opacity: 0;
  width: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.sidebar-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 12px 6px;
  white-space: nowrap;
  overflow: hidden;
}

.app-wrapper.sidebar-collapsed .sidebar-section-label {
  opacity: 0;
  height: 0;
  padding: 0;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: all var(--transition-fast);
  margin-bottom: 2px;
  position: relative;
  white-space: nowrap;
}

.sidebar-link i {
  font-size: 18px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-link span {
  transition: opacity var(--transition-fast);
}

.app-wrapper.sidebar-collapsed .sidebar-link span {
  opacity: 0;
  width: 0;
  overflow: hidden;
}

.sidebar-link:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand-gradient);
  border-radius: 0 3px 3px 0;
}

.sidebar-link .badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
}

.app-wrapper.sidebar-collapsed .sidebar-link .badge {
  display: none;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border-color);
}

.sidebar-collapse-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-collapse-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */
.app-navbar {
  position: fixed;
  top: 12px;
  left: calc(var(--sidebar-width) + 16px);
  right: 16px;
  height: var(--navbar-height);
  background: var(--bg-navbar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  z-index: 1030;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: left var(--transition-base);
}

.app-wrapper.sidebar-collapsed .app-navbar {
  left: calc(var(--sidebar-collapsed-width) + 16px);
}

.navbar-search {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.navbar-search input {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.navbar-search input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--brand-primary-light);
}

.navbar-search input::placeholder {
  color: var(--text-muted);
}

.navbar-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.navbar-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
  display: none;
  z-index: 1050;
}

.navbar-search-results.show {
  display: block;
  animation: fadeInDown 0.2s ease-out;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-primary);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.search-result-item:hover {
  background: var(--bg-surface-hover);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.navbar-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  font-size: 18px;
}

.navbar-icon-btn:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.navbar-icon-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
  border: 2px solid var(--bg-navbar);
}

.navbar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.navbar-profile:hover {
  border-color: var(--border-color-strong);
  box-shadow: var(--shadow-sm);
}

.navbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: var(--text-sm);
}

.navbar-profile-info {
  line-height: 1.3;
}

.navbar-profile-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.navbar-profile-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-glass {
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--border-color) !important;
  padding: 16px 20px !important;
  font-weight: 600;
}

.card-body {
  padding: 20px !important;
}

.card-footer {
  background: var(--bg-muted) !important;
  border-top: 1px solid var(--border-color) !important;
  padding: 12px 20px !important;
}

.card-gradient-border {
  position: relative;
  border: none !important;
}

.card-gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: var(--brand-gradient);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Stat Cards
   -------------------------------------------------------------------------- */
.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
  animation: fadeInUp 0.5s ease-out backwards;
}

.stat-card:nth-child(1) { animation-delay: 0.05s; }
.stat-card:nth-child(2) { animation-delay: 0.1s; }
.stat-card:nth-child(3) { animation-delay: 0.15s; }
.stat-card:nth-child(4) { animation-delay: 0.2s; }

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-color-strong);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 120px;
  height: 120px;
  background: var(--brand-gradient-subtle);
  border-radius: 50%;
  transform: translate(30%, -30%);
  pointer-events: none;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 12px;
}

.stat-card-icon.primary { background: var(--brand-primary-light); color: var(--brand-primary); }
.stat-card-icon.success { background: var(--color-success-bg); color: var(--color-success); }
.stat-card-icon.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.stat-card-icon.info { background: var(--color-info-bg); color: var(--color-info); }
.stat-card-icon.danger { background: var(--color-danger-bg); color: var(--color-danger); }

.stat-card-label {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}

.stat-card-value {
  font-size: var(--text-2xl);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-card-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-top: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-card-change.up {
  color: var(--color-success);
  background: var(--color-success-bg);
}

.stat-card-change.down {
  color: var(--color-danger);
  background: var(--color-danger-bg);
}

/* --------------------------------------------------------------------------
   Buttons — Bootstrap Overrides
   -------------------------------------------------------------------------- */
.btn {
  font-weight: 500;
  font-size: var(--text-sm);
  border-radius: var(--radius-md) !important;
  padding: 8px 16px;
  transition: all var(--transition-fast);
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--brand-gradient) !important;
  border: none !important;
  color: white !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover,
.btn-primary:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4) !important;
  filter: brightness(1.05);
}

.btn-outline-primary {
  border-color: var(--brand-primary) !important;
  color: var(--brand-primary) !important;
}

.btn-outline-primary:hover {
  background: var(--brand-primary-light) !important;
  color: var(--brand-primary-hover) !important;
}

.btn-secondary,
.btn-outline-secondary {
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
  background: var(--bg-surface) !important;
}

.btn-secondary:hover,
.btn-outline-secondary:hover {
  background: var(--bg-surface-hover) !important;
  color: var(--text-primary) !important;
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: 12px 24px;
  font-size: var(--text-base);
}

.btn-sm {
  padding: 5px 12px;
  font-size: var(--text-xs);
}

.btn-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  border: none;
  box-shadow: var(--shadow-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  cursor: pointer;
  z-index: 1020;
  transition: all var(--transition-base);
}

.btn-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.form-control,
.form-select {
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-md) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  font-size: var(--text-sm);
  padding: 10px 14px;
  transition: all var(--transition-fast);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px var(--brand-primary-light) !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
}

.form-control::placeholder {
  color: var(--text-muted);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-floating > .form-control {
  height: calc(3.25rem + 2px);
}

.input-group-text {
  background: var(--bg-muted) !important;
  border-color: var(--border-color) !important;
  color: var(--text-secondary) !important;
  border-radius: var(--radius-md) !important;
}

.form-check-input:checked {
  background-color: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
}

.form-switch .form-check-input {
  width: 2.5em;
  height: 1.25em;
}

.invalid-feedback {
  font-size: var(--text-xs);
}

/* --------------------------------------------------------------------------
   Tables & DataTables
   -------------------------------------------------------------------------- */
.table {
  color: var(--text-primary);
  --bs-table-bg: transparent;
  --bs-table-hover-bg: var(--bg-surface-hover);
  font-size: var(--text-sm);
}

.table thead th {
  font-weight: 600;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom-color: var(--border-color) !important;
  padding: 12px 16px;
  background: var(--bg-muted);
}

.table tbody td {
  padding: 14px 16px;
  border-bottom-color: var(--border-color) !important;
  vertical-align: middle;
}

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 6px 12px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border-color) !important;
  margin: 0 2px;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: white !important;
}

/* --------------------------------------------------------------------------
   Badges & Status
   -------------------------------------------------------------------------- */
.badge {
  font-weight: 500;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.badge-soft-primary { background: var(--brand-primary-light); color: var(--brand-primary); }
.badge-soft-success { background: var(--color-success-bg); color: var(--color-success); }
.badge-soft-warning { background: var(--color-warning-bg); color: var(--color-warning); }
.badge-soft-danger { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-soft-info { background: var(--color-info-bg); color: var(--color-info); }

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.status-dot.active { background: var(--color-success); box-shadow: 0 0 0 3px var(--color-success-bg); }
.status-dot.inactive { background: var(--text-muted); }
.status-dot.warning { background: var(--color-warning); box-shadow: 0 0 0 3px var(--color-warning-bg); }

/* --------------------------------------------------------------------------
   Modals
   -------------------------------------------------------------------------- */
.modal-content {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-xl) !important;
  box-shadow: var(--shadow-xl) !important;
  overflow: hidden;
}

.modal-header {
  border-bottom-color: var(--border-color) !important;
  padding: 20px 24px !important;
}

.modal-body {
  padding: 24px !important;
}

.modal-footer {
  border-top-color: var(--border-color) !important;
  padding: 16px 24px !important;
  background: var(--bg-muted);
}

.modal-backdrop.show {
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Slide Panel
   -------------------------------------------------------------------------- */
.slide-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-elevated);
  border-left: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  z-index: 1060;
  transform: translateX(100%);
  transition: transform var(--transition-base);
  display: flex;
  flex-direction: column;
}

.slide-panel.open {
  transform: translateX(0);
}

.slide-panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.slide-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.slide-panel-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1055;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.slide-panel-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   Toasts
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  top: 88px;
  right: 20px;
  z-index: 1090;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: var(--glass-blur);
}

.toast-item.removing {
  animation: slideOutRight 0.3s ease-in forwards;
}

.toast-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}

.toast-icon.success { background: var(--color-success-bg); color: var(--color-success); }
.toast-icon.error { background: var(--color-danger-bg); color: var(--color-danger); }
.toast-icon.warning { background: var(--color-warning-bg); color: var(--color-warning); }
.toast-icon.info { background: var(--color-info-bg); color: var(--color-info); }

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin-bottom: 2px;
}

.toast-message {
  font-size: var(--text-xs);
  color: var(--text-secondary);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 16px;
  line-height: 1;
}

.toast-close:hover {
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Skeleton Loaders
   -------------------------------------------------------------------------- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-muted) 25%, var(--bg-surface-hover) 50%, var(--bg-muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-text.short { width: 60%; }
.skeleton-text.medium { width: 80%; }
.skeleton-text.long { width: 100%; }

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.skeleton-card {
  height: 120px;
  border-radius: var(--radius-lg);
}

.skeleton-chart {
  height: 280px;
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */
.activity-timeline {
  position: relative;
  padding-left: 28px;
}

.activity-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--border-color);
  border-radius: 1px;
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
  animation: fadeInUp 0.4s ease-out backwards;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--brand-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.timeline-dot i {
  font-size: 8px;
  color: var(--brand-primary);
}

.timeline-content {
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: background var(--transition-fast);
}

.timeline-content:hover {
  background: var(--bg-surface-hover);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
}

.timeline-text {
  font-size: var(--text-sm);
  color: var(--text-primary);
  margin: 4px 0 0;
}

/* --------------------------------------------------------------------------
   Progress & Queue
   -------------------------------------------------------------------------- */
.progress {
  height: 8px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  background: var(--brand-gradient);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-color);
}

.queue-item:last-child {
  border-bottom: none;
}

.queue-stat {
  text-align: center;
  flex: 1;
}

.queue-stat-value {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.queue-stat-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------------------------------------
   Contact Cards Grid
   -------------------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.contact-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: all var(--transition-base);
  cursor: pointer;
}

.contact-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-primary-light);
}

.contact-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--brand-gradient-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--brand-primary);
  font-size: var(--text-lg);
}

.contact-card.selected {
  border-color: var(--brand-primary);
  box-shadow: var(--shadow-glow);
}

/* --------------------------------------------------------------------------
   Campaign Wizard
   -------------------------------------------------------------------------- */
.wizard-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 32px;
  padding: 0;
  list-style: none;
}

.wizard-step {
  flex: 1;
  display: flex;
  align-items: center;
  position: relative;
}

.wizard-step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--text-muted);
  background: var(--bg-surface);
  transition: all var(--transition-base);
  flex-shrink: 0;
  z-index: 1;
}

.wizard-step.active .wizard-step-number {
  border-color: var(--brand-primary);
  background: var(--brand-primary);
  color: white;
  box-shadow: var(--shadow-glow);
}

.wizard-step.completed .wizard-step-number {
  border-color: var(--color-success);
  background: var(--color-success);
  color: white;
}

.wizard-step-label {
  margin-left: 10px;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
}

.wizard-step.active .wizard-step-label {
  color: var(--text-primary);
}

.wizard-step-line {
  flex: 1;
  height: 2px;
  background: var(--border-color);
  margin: 0 12px;
}

.wizard-step.completed .wizard-step-line {
  background: var(--color-success);
}

.wizard-panel {
  display: none;
  animation: fadeInUp 0.4s ease-out;
}

.wizard-panel.active {
  display: block;
}

/* --------------------------------------------------------------------------
   Template Library Grid
   -------------------------------------------------------------------------- */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.template-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand-primary-light);
}

.template-preview {
  height: 180px;
  background: var(--bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.template-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.template-preview-placeholder {
  font-size: 48px;
  color: var(--text-muted);
  opacity: 0.4;
}

.template-card-body {
  padding: 16px;
}

.template-card-title {
  font-weight: 600;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}

.template-card-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.template-card-actions {
  display: flex;
  gap: 8px;
  padding: 0 16px 16px;
}

/* --------------------------------------------------------------------------
   Email Builder
   -------------------------------------------------------------------------- */
.builder-layout {
  display: grid;
  grid-template-columns: 260px 1fr 320px;
  gap: 0;
  height: calc(100vh - var(--navbar-height) - 48px);
  margin: -8px -24px -24px;
  border-top: 1px solid var(--border-color);
}

.builder-blocks {
  background: var(--bg-surface);
  border-right: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 16px;
}

.builder-block-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: grab;
  font-size: var(--text-sm);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.builder-block-item:hover {
  border-color: var(--brand-primary);
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

.builder-canvas {
  background: var(--bg-muted);
  overflow-y: auto;
  padding: 24px;
  display: flex;
  justify-content: center;
}

.builder-canvas-inner {
  width: 600px;
  min-height: 800px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0;
}

.builder-properties {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  overflow-y: auto;
  padding: 16px;
}

.builder-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
}

.builder-canvas-block {
  padding: 16px;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast);
  position: relative;
}

.builder-canvas-block:hover,
.builder-canvas-block.selected {
  border-color: var(--brand-primary);
}

.builder-canvas-block .block-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  gap: 4px;
}

.builder-canvas-block:hover .block-actions {
  display: flex;
}

.preview-mode-mobile .builder-canvas-inner {
  width: 375px;
}

.preview-mode-tablet .builder-canvas-inner {
  width: 768px;
}

/* --------------------------------------------------------------------------
   Auth Layout
   -------------------------------------------------------------------------- */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  background: var(--bg-body);
  background-image: var(--bg-body-gradient);
  z-index: 0;
}

.auth-bg-orbs {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: float 20s ease-in-out infinite;
}

.auth-orb-1 {
  width: 500px;
  height: 500px;
  background: rgba(99, 102, 241, 0.3);
  top: -10%;
  left: -10%;
}

.auth-orb-2 {
  width: 400px;
  height: 400px;
  background: rgba(139, 92, 246, 0.25);
  bottom: -10%;
  right: -5%;
  animation-delay: -7s;
}

.auth-orb-3 {
  width: 300px;
  height: 300px;
  background: rgba(6, 182, 212, 0.2);
  top: 40%;
  right: 30%;
  animation-delay: -14s;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 440px;
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: 40px;
  animation: fadeInUp 0.6s ease-out;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}

.auth-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  box-shadow: var(--shadow-glow);
}

.auth-logo-text {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.auth-title {
  text-align: center;
  margin-bottom: 8px;
}

.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: 28px;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: var(--text-xs);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

/* --------------------------------------------------------------------------
   Error Pages
   -------------------------------------------------------------------------- */
.error-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.error-code {
  font-size: 120px;
  font-weight: 800;
  line-height: 1;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
}

.error-title {
  font-size: var(--text-2xl);
  margin-bottom: 8px;
}

.error-message {
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 32px;
}

.maintenance-icon {
  font-size: 64px;
  color: var(--brand-primary);
  margin-bottom: 24px;
  animation: pulse 2s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */
.breadcrumb {
  background: transparent !important;
  padding: 0 !important;
  margin-bottom: 8px;
  font-size: var(--text-sm);
}

.breadcrumb-item a {
  color: var(--text-muted);
}

.breadcrumb-item.active {
  color: var(--text-secondary);
}

.breadcrumb-item + .breadcrumb-item::before {
  color: var(--text-muted) !important;
}

/* --------------------------------------------------------------------------
   Dropdown Overrides
   -------------------------------------------------------------------------- */
.dropdown-menu {
  background: var(--bg-elevated) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  padding: 8px !important;
  animation: fadeInDown 0.2s ease-out;
}

.dropdown-item {
  color: var(--text-primary) !important;
  border-radius: var(--radius-sm) !important;
  padding: 8px 12px !important;
  font-size: var(--text-sm);
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--bg-surface-hover) !important;
  color: var(--text-primary) !important;
}

.dropdown-divider {
  border-color: var(--border-color) !important;
}

/* --------------------------------------------------------------------------
   Chart Container
   -------------------------------------------------------------------------- */
.chart-container {
  position: relative;
  height: 280px;
  width: 100%;
}

.chart-container-sm {
  height: 200px;
}

/* --------------------------------------------------------------------------
   SMTP Health Widget
   -------------------------------------------------------------------------- */
.smtp-health-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.smtp-health-item:last-child {
  border-bottom: none;
}

.smtp-health-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.smtp-health-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease;
}

.smtp-health-bar-fill.low { background: var(--color-success); }
.smtp-health-bar-fill.medium { background: var(--color-warning); }
.smtp-health-bar-fill.high { background: var(--color-danger); }

/* --------------------------------------------------------------------------
   Filter Pills
   -------------------------------------------------------------------------- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.filter-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--brand-primary-light);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   Empty State
   -------------------------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--brand-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 32px;
  color: var(--brand-primary);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: 8px;
}

.empty-state-text {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  max-width: 360px;
  margin: 0 auto 24px;
}

/* --------------------------------------------------------------------------
   View Toggle
   -------------------------------------------------------------------------- */
.view-toggle {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.view-toggle-btn {
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.view-toggle-btn.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -30px) scale(1.05); }
  66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

.animate-fade-in {
  animation: fadeInUp 0.4s ease-out;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1199.98px) {
  .builder-layout {
    grid-template-columns: 220px 1fr;
  }

  .builder-properties {
    display: none;
  }
}

@media (max-width: 991.98px) {
  .app-sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width) !important;
  }

  .app-wrapper.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .app-main {
    margin-left: 0 !important;
  }

  .app-navbar {
    left: 16px !important;
  }

  .navbar-profile-info {
    display: none;
  }

  .builder-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .builder-blocks {
    display: none;
  }
}

@media (max-width: 767.98px) {
  .app-content {
    padding: calc(var(--navbar-height) + 16px) 16px 16px;
  }

  .stat-card-value {
    font-size: var(--text-xl);
  }

  .wizard-step-label {
    display: none;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 28px 24px;
  }

  .toast-container {
    left: 16px;
    right: 16px;
  }

  .toast-item {
    min-width: auto;
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.text-gradient {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bg-gradient-brand {
  background: var(--brand-gradient);
}

.border-gradient {
  border-image: var(--brand-gradient) 1;
}

.glass {
  background: var(--bg-sidebar);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}

.hover-lift {
  transition: transform var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divider {
  height: 1px;
  background: var(--border-color);
  margin: 16px 0;
}

.cursor-pointer {
  cursor: pointer;
}

.opacity-50 {
  opacity: 0.5;
}

/* Bootstrap alert overrides */
.alert {
  border-radius: var(--radius-md) !important;
  border: none !important;
  font-size: var(--text-sm);
}

.alert-success { background: var(--color-success-bg) !important; color: var(--color-success) !important; }
.alert-danger { background: var(--color-danger-bg) !important; color: var(--color-danger) !important; }
.alert-warning { background: var(--color-warning-bg) !important; color: var(--color-warning) !important; }
.alert-info { background: var(--color-info-bg) !important; color: var(--color-info) !important; }

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color-strong);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-muted);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.theme-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--brand-gradient);
  transition: transform var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: white;
}

[data-theme="dark"] .theme-toggle-knob {
  transform: translateX(20px);
}

/* Offcanvas override */
.offcanvas {
  background: var(--bg-elevated) !important;
  border-color: var(--border-color) !important;
}

/* Nav tabs override */
.nav-tabs {
  border-bottom-color: var(--border-color) !important;
}

.nav-tabs .nav-link {
  color: var(--text-secondary);
  border: none !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  padding: 10px 16px;
  font-size: var(--text-sm);
  font-weight: 500;
}

.nav-tabs .nav-link:hover {
  color: var(--text-primary);
  border-bottom-color: var(--border-color) !important;
}

.nav-tabs .nav-link.active {
  color: var(--brand-primary) !important;
  background: transparent !important;
  border-bottom-color: var(--brand-primary) !important;
}
