/* Alpine.js WhatsApp Bot Manager - Neumorphic Design */
:root {
  /* Neumorphic Base Colors */
  --neuro-bg: #e6e7ee;
  --neuro-surface: #e6e7ee;
  --neuro-raised: #e9eaef;
  --neuro-pressed: #dfe0e6;

  /* Neumorphic Shadows */
  --neuro-shadow-light: #ffffff;
  --neuro-shadow-dark: #a3a8b8;

  /* Color Palette - Softer versions */
  --primary-color: #25d366;
  --primary-dark: #1da851;
  --primary-soft: rgba(37, 211, 102, 0.1);
  --primary-shadow: rgba(37, 211, 102, 0.3);

  --secondary-color: #128c7e;
  --accent-color: #34b7f1;
  --accent-soft: rgba(52, 183, 241, 0.1);

  --danger-color: #dc3545;
  --danger-soft: rgba(220, 53, 69, 0.1);
  --warning-color: #ffc107;
  --warning-soft: rgba(255, 193, 7, 0.1);
  --success-color: #28a745;
  --success-soft: rgba(40, 167, 69, 0.1);

  --dark-color: #2c3e50;
  --text-color: #2c3e50;
  --text-muted: #6c757d;
  --text-light: #8e9aaf;

  /* Legacy support */
  --light-color: var(--neuro-raised);
  --border-color: transparent;
  --bg-color: var(--neuro-bg);
  --card-bg: var(--neuro-surface);

  /* Neumorphic Shadows */
  --neuro-shadow-raised: 8px 8px 16px #a3a8b8, -8px -8px 16px #ffffff;

  --neuro-shadow-raised-sm: 4px 4px 8px #a3a8b8, -4px -4px 8px #ffffff;

  --neuro-shadow-pressed:
    inset 4px 4px 8px var(--neuro-shadow-dark), inset -4px -4px 8px var(--neuro-shadow-light);

  --neuro-shadow-pressed-sm:
    inset 2px 2px 4px var(--neuro-shadow-dark), inset -2px -2px 4px var(--neuro-shadow-light);

  /* Legacy shadows for compatibility */
  --shadow-sm: var(--neuro-shadow-raised-sm);
  --shadow-md: var(--neuro-shadow-raised);
  --shadow-lg: var(--neuro-shadow-raised);

  /* Radius - More rounded for neumorphism */
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--neuro-bg);
  color: var(--text-color);
  line-height: 1.6;
  min-height: 100vh;

  /* Subtle texture for neumorphism */
  background-image: radial-gradient(
    circle at 1px 1px,
    rgba(255, 255, 255, 0.15) 1px,
    transparent 0
  );
  background-size: 20px 20px;
}

/* Neumorphic Utility Classes - Removed unused classes */

/* App Container */
.app-container {
  min-height: 100vh;
  position: relative;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--card-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Authentication */
.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.auth-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 100%;
  max-width: 400px;
  backdrop-filter: blur(10px);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.auth-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.auth-form h2 {
  text-align: center;
  margin-bottom: 25px;
  font-weight: 500;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.auth-switch a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* Auth Form Elements - Clean styling without neumorphic effects */
.auth-form input,
.auth-form select,
.auth-form textarea {
  background: #ffffff !important;
  border: 1px solid #ced4da !important;
  border-radius: 6px !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075) !important;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out !important;
  padding: 12px 16px !important;
  font-size: 14px !important;
  color: #495057 !important;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  border-color: #25d366 !important;
  box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25) !important;
  outline: 0 !important;
}

.auth-form .btn {
  background: var(--primary-color) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3) !important;
  transition: all 0.2s ease !important;
}

.auth-form .btn:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4) !important;
}

.error-message {
  background: #fee;
  color: var(--danger-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 15px;
  text-align: center;
  font-size: 0.9rem;
}

/* Dashboard */
.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  background: var(--neuro-surface);
  border-bottom: none;
  padding: 0 20px;
  box-shadow: var(--neuro-shadow-raised-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  width: 100%;
  padding: 0 60px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-left i.fab.fa-whatsapp {
  font-size: 2rem;
  color: #25d366; /* WhatsApp green */
  transition: all 0.2s ease;
}

.header-left i.fab.fa-whatsapp:hover {
  color: #20b856;
  transform: scale(1.1);
}

/* Other header icons (fallback) */
.header-left i:not(.fa-whatsapp) {
  font-size: 2rem;
  color: var(--primary-color);
}

/* Chat welcome WhatsApp icon - clean and simple */
.chat-welcome i.fab.fa-whatsapp {
  font-size: 3rem;
  color: #25d366;
  margin-bottom: 16px;
  display: inline-block;
  transition: all 0.2s ease;
}

.chat-welcome i.fab.fa-whatsapp:hover {
  color: #20b856;
  transform: scale(1.1);
}

.header-left h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* User Info Display */
.user-info-display {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-details {
  text-align: right;
}

.user-name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.2;
}

.user-email {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

/* User Menu Dropdown */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.user-menu-trigger:hover {
  background: var(--neuro-raised);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-size: 0.875rem;
}

.user-menu-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 280px;
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow:
    var(--neuro-shadow-raised),
    0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--neuro-pressed);
  overflow: hidden;
  z-index: 1000;
  margin-top: 8px;
}

.menu-section {
  padding: 12px 0;
}

.user-profile-section {
  padding: 16px;
  background: var(--neuro-raised);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  margin-bottom: 2px;
}

.profile-email {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.profile-type {
  font-size: 0.7rem;
  color: var(--primary-color);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.menu-divider {
  height: 1px;
  background: var(--neuro-pressed);
  margin: 0 12px;
}

.menu-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: transparent;
  border: none;
  text-align: left;
  color: var(--text-color);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.menu-item:hover {
  background: var(--neuro-raised);
}

.menu-item i {
  width: 16px;
  color: var(--text-muted);
}

.logout-item {
  color: var(--danger-color);
}

.logout-item:hover {
  background: var(--danger-soft);
}

.logout-item i {
  color: var(--danger-color);
}

/* Language Options in Menu */
.language-options {
  padding: 0 8px;
}

.language-option {
  width: 100%;
  padding: 8px 16px;
  margin: 2px 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-color);
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition);
}

.language-option:hover {
  background: var(--neuro-raised);
}

.language-option.active {
  background: var(--primary-soft);
  color: var(--primary-color);
  font-weight: 600;
}

/* Submenu Styles */
.submenu-container {
  position: relative;
}

.submenu-trigger {
  justify-content: space-between;
}

.submenu-arrow {
  font-size: 0.75rem;
  transition: var(--transition);
  margin-left: auto;
}

.submenu-arrow.rotate-90 {
  transform: rotate(90deg);
}

.submenu {
  background: var(--neuro-raised);
  border-radius: var(--radius-md);
  margin: 4px 8px 8px 24px;
  padding: 4px 0;
  border-left: 2px solid var(--primary-soft);
}

.submenu-option {
  width: 100%;
  padding: 8px 16px;
  margin: 1px 0;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-color);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.submenu-option:hover {
  background: var(--neuro-surface);
}

.submenu-option.active {
  background: var(--primary-soft);
  color: var(--primary-color);
  font-weight: 600;
}

/* Profile Modal Specific Styles */
.readonly-input {
  background: var(--neuro-pressed) !important;
  cursor: not-allowed;
  opacity: 0.7;
}

.form-help {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

.success-message {
  background: var(--success-soft);
  color: var(--success-color);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin: 16px 0;
  border-left: 4px solid var(--success-color);
}

.dashboard-main {
  flex: 1;
  padding: 60px;
  width: 100%;
  display: grid;
  gap: 40px;
  grid-template-columns: 1fr;
  min-height: calc(100vh - 70px);
}

/* Cards */
.status-card,
.qr-card,
.logs-card,
.knowledge-card,
.crm-card,
.settings-card {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  border: none;
  overflow: visible;
  transition: var(--transition);
  margin: 20px;
  position: relative;
}

/* QR Section - inside conversations panel */
/* QR Card - standard card styling */
.qr-card {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  border: none;
  overflow: visible;
  transition: var(--transition);
  margin: 20px;
  position: relative;
}

.qr-container {
  padding: 20px;
  text-align: center;
}

.qr-instructions {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
  line-height: 1.4;
}

.qr-image-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 200px;
}

.qr-image {
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.qr-loading p {
  color: var(--text-muted);
  margin: 0;
}

/* Inline QR Code Styles */
.qr-code-inline {
  margin-top: 20px;
  padding: 15px;
  background: var(--neuro-surface);
  border-radius: var(--radius-md);
  box-shadow: var(--neuro-shadow-pressed-sm);
}

.qr-container-inline {
  text-align: center;
}

.qr-image-container-inline {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}

.qr-image-inline {
  max-width: 180px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.qr-loading-inline {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px;
}

.qr-loading-inline p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.9rem;
}

/* Bot Controls Layout - Always vertical stacking with consistent spacing */
.unbound-bot-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bound-bot-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bound-bot-controls button {
  width: 100%;
  min-width: 140px;
  padding: 12px 24px;
  font-size: 0.875rem;
}

/* Hide mobile QR overlay on desktop */
.mobile-qr-overlay {
  display: none;
}

.status-card:hover,
.qr-card:hover,
.logs-card:hover,
.knowledge-card:hover,
.crm-card:hover,
.settings-card:hover,
.stats-card:hover,
.conversations-panel:hover {
  box-shadow:
    16px 16px 32px var(--neuro-shadow-dark),
    -16px -16px 32px var(--neuro-shadow-light);
  transform: translateY(-2px);
}

.status-card .card-header,
.qr-card .card-header,
.logs-card .card-header,
.knowledge-card .card-header,
.crm-card .card-header,
.settings-card .card-header {
  padding: 20px 24px;
  background: var(--neuro-raised);
  border-bottom: none;
  margin-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 1px 2px rgba(163, 168, 184, 0.1);
}

/* Special layout for status card header - stack vertically */
.status-card .card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.status-card .card-header h3 {
  margin: 0;
}

.status-card .card-header .status-indicator {
  align-self: flex-start;
}

/* Bot Controls - Consistent button sizing - Always vertical */
.bot-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

/* QR Instructions Inline */
.qr-instructions-inline {
  background: var(--accent-soft);
  border: 1px solid rgba(52, 183, 241, 0.2);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 8px 0;
}

.qr-instructions-inline .instruction-text {
  font-size: 0.85rem;
  color: var(--text-color);
  margin: 0;
  line-height: 1.4;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.qr-instructions-inline .instruction-text i {
  color: var(--accent-color);
  margin-top: 1px;
  flex-shrink: 0;
}

.bot-controls .btn {
  width: 100% !important;
  min-width: 140px;
  padding: 12px 24px !important;
  font-size: 0.875rem !important;
  justify-content: center;
  text-align: center;
  margin: 0 !important; /* Override any inline margins */
  box-sizing: border-box;
  flex-shrink: 0;
  white-space: nowrap;
}

.bot-controls .btn span {
  display: inline-block;
  min-width: 80px;
  text-align: center;
}

.bot-controls .btn i {
  width: 16px;
  text-align: center;
  margin-right: 8px;
}

/* Clear Binding Button */
.btn-outline-danger {
  color: var(--danger-color);
  border: 1px solid var(--danger-color);
  background: transparent;
}

.btn-outline-danger:hover {
  color: white;
  background: var(--danger-color);
}

.btn-outline-danger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Knowledge Base Card - Improved header layout */
.knowledge-card .card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.knowledge-card .card-header h3 {
  margin: 0;
}

.knowledge-card .card-header .btn {
  align-self: flex-start;
  width: auto;
}

/* CRM Card specific styling */
.crm-card .crm-buttons {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.crm-card .crm-buttons .btn {
  justify-content: flex-start;
  text-align: left;
}

.crm-card .card-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.crm-card .card-header h3 {
  margin: 0;
}

/* Card content padding to prevent stretching */
.status-card .bot-details,
.status-card .bot-controls,
.status-card .no-bot-message,
.qr-card .qr-content,
.logs-card .logs-content,
.knowledge-card .files-list,
.knowledge-card .drag-overlay,
.settings-card .setting-item {
  padding: 20px 24px;
}

/* Base card header styling */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-card .card-header h3,
.qr-card .card-header h3,
.logs-card .card-header h3,
.knowledge-card .card-header h3,
.settings-card .card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-card .card-header h3 i,
.qr-card .card-header h3 i,
.logs-card .card-header h3 i,
.knowledge-card .card-header h3 i,
.settings-card .card-header h3 i {
  font-size: 1rem;
  color: var(--primary-color);
}

/* Neumorphic Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  background: var(--neuro-surface);
  color: var(--text-color);
  box-shadow: var(--neuro-shadow-raised-sm);
}

.btn:hover:not(:disabled) {
  background: var(--neuro-raised);
  transform: translateY(-1px);
  box-shadow:
    6px 6px 12px var(--neuro-shadow-dark),
    -6px -6px 12px var(--neuro-shadow-light);
}

.btn:active:not(:disabled) {
  background: var(--neuro-pressed);
  transform: translateY(0);
  box-shadow: var(--neuro-shadow-pressed-sm);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--neuro-surface);
  color: var(--text-muted);
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow:
    4px 4px 8px rgba(37, 211, 102, 0.3),
    -4px -4px 8px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
  box-shadow:
    6px 6px 12px rgba(37, 211, 102, 0.4),
    -6px -6px 12px rgba(255, 255, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #20894a 100%);
  color: white;
  box-shadow:
    4px 4px 8px rgba(40, 167, 69, 0.3),
    -4px -4px 8px rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #c82333 100%);
  color: white;
  box-shadow:
    4px 4px 8px rgba(220, 53, 69, 0.3),
    -4px -4px 8px rgba(255, 255, 255, 0.1);
}

.btn-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #e0a800 100%);
  color: var(--dark-color);
  box-shadow:
    4px 4px 8px rgba(255, 193, 7, 0.3),
    -4px -4px 8px rgba(255, 255, 255, 0.1);
}

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

.btn-ghost:hover:not(:disabled) {
  background: var(--neuro-raised);
  color: var(--text-color);
  box-shadow: var(--neuro-shadow-raised-sm);
}

.card-header h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 600;
}

.card-header i {
  color: var(--primary-color);
}

.card-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 5px 0 0 0;
}

/* Status Indicator */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.active {
  background-color: var(--success-color);
}
.status-dot.inactive {
  background-color: var(--text-muted);
}
.status-dot.waiting_qr {
  background-color: var(--warning-color);
}
.status-dot.error {
  background-color: var(--danger-color);
}

.status-text {
  font-weight: 500;
  font-size: 0.9rem;
}

/* Bot Details */
.bot-details {
  padding: 12px 16px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row label {
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.detail-row span {
  color: var(--text-color);
  font-size: 0.85rem;
  font-weight: 500;
}

.no-bot-message {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  background: var(--light-color);
  border-radius: var(--radius-sm);
  margin: 12px 16px;
  font-size: 0.85rem;
}

/* Bot Controls - Always vertical stacking with consistent sizing */
.bot-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
}

.bot-controls .btn {
  width: 100%;
  font-size: 0.875rem;
  padding: 12px 24px;
  min-width: 140px;
}

.create-bot-section {
  text-align: center;
  padding: 16px 20px;
}

/* QR Code */
.qr-container {
  text-align: center;
  padding: 16px;
}

.qr-instructions {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 0;
}

.qr-image {
  max-width: 200px;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* Logs */
.logs-container {
  max-height: 200px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: 12px 16px;
}

.log-entry {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border-left: 3px solid;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.log-entry.log-info {
  background-color: #f8f9fa;
  border-left-color: var(--accent-color);
}

.log-entry.log-success {
  background-color: #d4edda;
  border-left-color: var(--success-color);
}

.log-entry.log-error {
  background-color: #f8d7da;
  border-left-color: var(--danger-color);
}

.log-entry.log-warning {
  background-color: #fff3cd;
  border-left-color: var(--warning-color);
}

.log-time {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.log-message {
  color: var(--text-color);
  flex: 1;
}

.no-logs {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-style: italic;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  transition: var(--transition);
  background: var(--card-bg);
  color: var(--text-color);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Buttons - Standardized sizing */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  user-select: none;
  min-width: 140px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--text-muted);
  color: white;
}

.btn-secondary:hover:not(:disabled) {
  background: var(--dark-color);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success-color);
  color: white;
}

.btn-success:hover:not(:disabled) {
  background: #218838;
  transform: translateY(-1px);
}

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

.btn-danger:hover:not(:disabled) {
  background: #c82333;
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-color);
  color: var(--text-color);
}

.btn-sm {
  padding: 10px 20px;
  font-size: 0.8rem;
  min-width: 120px;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-content {
  background: #ffffff;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 25px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

.modal-close:hover {
  background: #f8f9fa;
  color: #343a40;
}

.modal-form {
  padding: 25px;
}

/* Modal Form Elements - Clean styling without neumorphic effects */
.modal-form input,
.modal-form select,
.modal-form textarea {
  background: #ffffff !important;
  border: 1px solid #ced4da !important;
  border-radius: 6px !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.075) !important;
  transition:
    border-color 0.15s ease-in-out,
    box-shadow 0.15s ease-in-out !important;
}

.modal-form input:focus,
.modal-form select:focus,
.modal-form textarea:focus {
  border-color: #25d366 !important;
  box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.25) !important;
  outline: 0 !important;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Neumorphic Responsive Design - Fluid Breakpoints */

/* Large Screens - Maximum neumorphic effect */
@media (min-width: 1400px) {
  .dashboard-main {
    padding: 80px;
    gap: 60px;
  }

  .header-content {
    padding: 0 80px;
  }

  .status-card,
  .qr-card,
  .logs-card,
  .conversations-panel,
  .stats-card,
  .knowledge-card,
  .crm-card,
  .settings-card {
    margin: 30px;
  }
}

/* Medium-Large Screens */
@media (max-width: 1399px) and (min-width: 1024px) {
  .dashboard-main {
    padding: 60px;
    gap: 40px;
  }

  .header-content {
    padding: 0 60px;
  }
}

/* Tablet Landscape */
@media (max-width: 1023px) and (min-width: 769px) {
  .dashboard-main {
    padding: 40px;
    gap: 30px;
  }

  .header-content {
    padding: 0 40px;
  }

  .status-card,
  .qr-card,
  .logs-card,
  .conversations-panel,
  .stats-card,
  .knowledge-card,
  .crm-card,
  .settings-card {
    margin: 15px;
  }

  .stats-logs-panel {
    width: 100%;
    flex-direction: row;
  }
}

/* Mobile and Tablet Portrait */
@media (max-width: 768px) {
  .dashboard-main {
    padding: 30px 20px;
    gap: 20px;
    grid-template-columns: 1fr;
    grid-template-areas: none; /* Reset any grid areas on mobile */
  }

  .dashboard-sidebar {
    width: 100% !important; /* Full width on mobile */
    padding-right: 0 !important; /* Remove right padding on mobile */
  }

  .header-content {
    padding: 0 20px;
  }

  /* Mobile User Menu Adjustments */
  .user-info-display {
    display: none; /* Hide user info text on mobile */
  }

  .user-menu-dropdown {
    width: 260px;
    right: -10px; /* Adjust positioning for mobile */
  }

  .user-profile-section {
    padding: 20px 16px;
  }

  .profile-avatar {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .profile-name {
    font-size: 1rem;
  }

  .profile-email {
    font-size: 0.85rem;
  }

  .status-card,
  .qr-card,
  .logs-card,
  .conversations-panel,
  .stats-card,
  .knowledge-card,
  .settings-card {
    margin: 10px;
    width: auto;
    grid-area: auto; /* Reset any inherited grid areas */
  }

  /* Hide desktop QR card on mobile */
  .qr-card {
    display: none !important;
  }

  /* Mobile QR overlay - show when condition is met */
  .mobile-qr-overlay:not([style*='display: none']) {
    display: block !important; /* Show when Alpine.js condition is true */
    background: #25d366; /* WhatsApp green */
    border-radius: 12px;
    margin: 16px 0;
    padding: 0;
    overflow: hidden;
  }

  .mobile-qr-content {
    background: white;
    margin: 3px;
    border-radius: 9px;
    padding: 20px;
    text-align: center;
  }

  .mobile-qr-content h3 {
    margin: 0 0 8px 0;
    color: #25d366;
    font-size: 1.1rem;
  }

  .mobile-qr-content p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 0.9rem;
  }

  .mobile-qr-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
  }

  .mobile-qr-image {
    max-width: 200px;
    width: 100%;
    height: auto;
    border-radius: 8px;
  }

  /* Conversations panel should come after QR code on mobile */
  .conversations-panel {
    order: -5; /* Lower priority than QR code but higher than other cards */
    position: relative; /* For QR card positioning */
  }

  /* Other cards have default order (0) so they come after QR and conversations */
  .status-card {
    order: -15; /* Status card first */
  }

  .knowledge-card {
    order: -3; /* Show files after QR and conversations but before other cards */
  }

  .settings-card,
  .logs-card,
  .stats-card {
    order: 5; /* These come last on mobile */
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* Override specific card header layouts on mobile */
  .status-card .card-header,
  .knowledge-card .card-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .status-indicator {
    align-self: flex-end;
  }

  .bot-controls {
    flex-direction: column;
    gap: 12px;
  }

  .bot-controls .btn {
    width: 100% !important;
    min-width: 140px;
    padding: 12px 24px !important;
    font-size: 0.875rem !important;
    flex: none;
    margin: 0 !important;
  }

  .header-left h1 {
    display: none;
  }

  .auth-card {
    padding: 30px 25px;
    background: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
  }

  /* Mobile QR code styling */
  .qr-image {
    max-width: 280px; /* Increased size */
    width: 100%;
    height: auto;
    margin: 0 auto; /* Center the image */
    display: block;
  }

  .qr-container {
    padding: 24px 20px; /* More padding */
    text-align: center; /* Center content */
    background: var(--neuro-surface);
    border-radius: var(--radius-lg);
  }

  /* Mobile QR debugging */
  .mobile-qr-test {
    background: #ff0000 !important;
    border: 5px solid #00ff00 !important;
    min-height: 200px !important;
  }

  .mobile-qr-test::before {
    content: 'MOBILE QR TEST' !important;
    color: white !important;
    font-weight: bold !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
  }

  /* Smaller shadows on mobile for performance */
  .status-card:hover,
  .qr-card:hover,
  .logs-card:hover,
  .conversations-panel:hover,
  .stats-card:hover,
  .knowledge-card:hover,
  .settings-card:hover {
    box-shadow:
      8px 8px 16px var(--neuro-shadow-dark),
      -8px -8px 16px var(--neuro-shadow-light);
    transform: translateY(-1px);
  }
}

/* Small Mobile */
@media (max-width: 480px) {
  .dashboard-main {
    padding: 20px 15px;
    gap: 15px;
  }

  .header-content {
    padding: 0 15px;
  }

  .status-card,
  .qr-card,
  .logs-card,
  .conversations-panel,
  .stats-card,
  .knowledge-card,
  .settings-card {
    margin: 8px;
  }

  .auth-card {
    padding: 25px 20px;
    background: #ffffff !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px) !important;
  }
}

/* Ensure card content has proper padding inside the neumorphic containers */
.status-card .card-content,
.qr-card .card-content,
.logs-card .logs-content,
.conversations-panel .conversations-content,
.stats-card .stats-content {
  overflow: auto;
}

/* Responsive Grid */
@media (min-width: 1024px) {
  .dashboard-main {
    grid-template-columns: 2fr 1fr;
    grid-template-areas:
      'status qr'
      'logs logs';
  }

  .status-card {
    grid-area: status;
  }

  .qr-card {
    grid-area: qr;
  }

  .logs-card {
    grid-area: logs;
  }
}

/* Animations */
[x-cloak] {
  display: none !important;
}

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

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

/* Utility Classes */
.text-center {
  text-align: center;
}
.text-muted {
  color: var(--text-muted);
}
.text-success {
  color: var(--success-color);
}
.text-danger {
  color: var(--danger-color);
}
.text-warning {
  color: var(--warning-color);
}

.mb-0 {
  margin-bottom: 0;
}
.mb-1 {
  margin-bottom: 0.25rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-3 {
  margin-bottom: 1rem;
}
.mb-4 {
  margin-bottom: 1.5rem;
}
.mb-5 {
  margin-bottom: 3rem;
}

.d-flex {
  display: flex;
}
.d-none {
  display: none;
}
.d-block {
  display: block;
}

.justify-content-center {
  justify-content: center;
}
.justify-content-between {
  justify-content: space-between;
}
.align-items-center {
  align-items: center;
}

/* Dashboard Layout Updates */
.dashboard-main {
  display: flex;
  height: calc(100vh - 80px);
  gap: 20px;
  padding: 20px 40px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
}

.dashboard-sidebar {
  width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-right: 8px;
}

.conversations-panel {
  flex: 1;
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  display: flex;
  flex-direction: column;
  overflow: visible;
  transition: var(--transition);
  margin: 20px;
  position: relative;
}

/* Stats and Logs Panel */
.stats-logs-panel {
  width: 300px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
  min-height: 0; /* Allow flex children to shrink */
  padding-left: 8px;
}

.stats-card {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  overflow: visible;
  transition: var(--transition);
  margin: 20px;
  position: relative;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 20px 24px;
}

.stat-item {
  text-align: center;
  padding: 24px 32px !important;
  background: var(--neuro-surface);
  border-radius: var(--radius-md);
  border: none;
  transition: var(--transition);
  box-shadow: var(--neuro-shadow-pressed-sm);
}

.stat-item:hover {
  background: var(--neuro-raised);
  box-shadow: var(--neuro-shadow-raised-sm);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin: 4px 8px 8px 8px;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 8px;
}

.logs-card {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  overflow: visible;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  margin: 20px;
  position: relative;
  min-height: 0; /* Allow flex child to shrink */
}

.logs-card:hover {
  box-shadow:
    16px 16px 32px var(--neuro-shadow-dark),
    -16px -16px 32px var(--neuro-shadow-light);
  transform: translateY(-2px);
}

.logs-content {
  height: calc(100% - 60px); /* Full height minus header */
  overflow-y: auto;
  padding: 20px 24px;
}

.log-entry {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
}

.log-entry.log-info {
  background: rgba(52, 183, 241, 0.1);
  border-left: 3px solid var(--accent-color);
}

.log-entry.log-success {
  background: rgba(40, 167, 69, 0.1);
  border-left: 3px solid var(--success-color);
}

.log-entry.log-warning {
  background: rgba(255, 193, 7, 0.1);
  border-left: 3px solid var(--warning-color);
}

.log-entry.log-error {
  background: rgba(220, 53, 69, 0.1);
  border-left: 3px solid var(--danger-color);
}

.log-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 50px;
}

.log-message {
  flex: 1;
  line-height: 1.4;
}

.no-logs {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.no-logs i {
  font-size: 2rem;
  margin-bottom: 8px;
  display: block;
}

/* Mobile Navigation */
.mobile-navbar {
  display: none;
  background: var(--neuro-surface);
  border-bottom: none;
  box-shadow: var(--neuro-shadow-raised-sm);
  position: sticky;
  top: 70px;
  z-index: 90;
  backdrop-filter: blur(10px);
}

.mobile-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.mobile-bot-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
}

.mobile-menu-toggle {
  background: var(--neuro-surface);
  border: none;
  font-size: 1.25rem;
  color: var(--text-color);
  cursor: pointer;
  padding: 12px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  box-shadow: var(--neuro-shadow-raised-sm);
}

.mobile-menu-toggle:hover {
  background: var(--neuro-raised);
  color: var(--primary-color);
  transform: translateY(-1px);
}

.mobile-menu-toggle:active {
  background: var(--neuro-pressed);
  box-shadow: var(--neuro-shadow-pressed-sm);
  transform: translateY(0);
}

.mobile-menu-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--neuro-surface);
  border-top: none;
  box-shadow: var(--neuro-shadow-raised);
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.mobile-menu-section {
  padding: 20px;
  border-bottom: 1px solid rgba(163, 168, 184, 0.1);
}

.mobile-menu-section:last-child {
  border-bottom: none;
}

.mobile-menu-section h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-color);
}

.mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-action-btn {
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 140px;
}

.mobile-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mobile-action-btn.btn-success {
  background: var(--success-color);
  color: white;
}

.mobile-action-btn.btn-danger {
  background: var(--danger-color);
  color: white;
}

.mobile-action-btn.btn-warning {
  background: var(--warning-color);
  color: var(--dark-color);
}

.mobile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.mobile-stat {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-color);
  border-radius: var(--radius-md);
}

.mobile-stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
}

.mobile-stat-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.mobile-menu-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--bg-color);
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  color: var(--text-color);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
  min-width: 140px;
}

.mobile-menu-option:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
}

.mobile-menu-option:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Menu Transitions */
.mobile-menu-enter {
  transition: all 0.3s ease-out;
}

.mobile-menu-enter-start {
  opacity: 0;
  transform: translateY(-10px);
}

.mobile-menu-enter-end {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-leave {
  transition: all 0.2s ease-in;
}

.mobile-menu-leave-start {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-leave-end {
  opacity: 0;
  transform: translateY(-10px);
}

/* Conversations Header */
.conversations-header {
  background: var(--primary-color);
  color: white;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.conversations-header h2 {
  margin: 0;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.conversations-header button {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.conversations-header button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
}

.conversations-header button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Contacts Section */
.contacts-section {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
}

.contacts-section h3 {
  margin: 0 0 15px 0;
  font-size: 1.1rem;
  color: var(--text-muted);
}

.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 300px;
  overflow-y: auto;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.contact-item:hover {
  background: var(--light-color);
}

.contact-item.active {
  background: var(--primary-color);
  color: white;
}

.contact-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  margin-right: 12px;
  font-size: 1.2rem;
}

.contact-item.active .contact-avatar {
  background: rgba(255, 255, 255, 0.2);
}

.contact-info {
  flex: 1;
  min-width: 0;
}

.contact-name {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 2px;
}

.contact-number {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.contact-item.active .contact-number {
  color: rgba(255, 255, 255, 0.8);
}

.last-message {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-item.active .last-message {
  color: rgba(255, 255, 255, 0.9);
}

.contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.contact-item.active .message-time {
  color: rgba(255, 255, 255, 0.8);
}

.unread-badge {
  background: var(--primary-color);
  color: white;
  border-radius: 10px;
  padding: 2px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
}

.contact-item.active .unread-badge {
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-color);
}

.no-conversations {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
  font-style: italic;
}

/* Chat Section */
.chat-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  background: var(--light-color);
}

.chat-contact-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-contact-info i {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-contact-name {
  font-weight: 600;
  font-size: 1rem;
}

.chat-contact-number {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f0f2f5;
  max-width: 100%;
  box-sizing: border-box;
}

.message {
  max-width: 70%;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
}

.user-message {
  align-self: flex-end;
}

.bot-message {
  align-self: flex-start;
}

.message-content {
  padding: 10px 15px;
  border-radius: 15px;
  margin-bottom: 2px;
  position: relative;
  word-wrap: break-word;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
  box-sizing: border-box;
}

.user-message .message-content {
  background: var(--primary-color);
  color: white;
  border-bottom-right-radius: 5px;
}

.bot-message .message-content {
  background: white;
  color: var(--text-color);
  border-bottom-left-radius: 5px;
  box-shadow: var(--shadow-sm);
}

.message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 1px;
}

.user-message .message-time {
  color: rgba(255, 255, 255, 0.8);
}

.bot-message .message-time {
  text-align: left;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--light-color);
  border-top: 1px solid var(--border-color);
  font-size: 0.9rem;
  color: var(--text-muted);
}

.typing-dots {
  display: flex;
  gap: 3px;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary-color);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.typing-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes typing {
  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Chat Welcome */
.chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  background: #f0f2f5;
}

.chat-welcome i {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 20px;
}

.chat-welcome h3 {
  color: var(--primary-color);
  margin-bottom: 10px;
  font-size: 1.5rem;
}

/* Sidebar Cards */
.stats-card,
.knowledge-card,
.settings-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.card-header {
  padding: 12px 16px;
  background: var(--light-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 i {
  font-size: 1rem;
  color: var(--primary-color);
}

.stats-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 16px;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

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

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

.knowledge-list {
  padding: 12px 16px;
  min-height: 180px;
  max-height: 300px;
  overflow-y: auto;
}

.knowledge-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition);
}

.knowledge-item:last-child {
  border-bottom: none;
}

.knowledge-item:hover {
  background: rgba(37, 211, 102, 0.02);
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: var(--radius-sm);
}

.file-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--light-color);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.file-icon i {
  font-size: 1.1rem;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-color);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-details {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.file-category {
  font-weight: 500;
  padding: 2px 6px;
  background: var(--light-color);
  border-radius: 10px;
}

.file-separator {
  opacity: 0.5;
}

.file-type {
  font-weight: 500;
  font-family: monospace;
}

.file-date {
  font-style: italic;
}

.file-actions {
  display: flex;
  align-items: center;
  opacity: 0;
  transition: var(--transition);
}

.knowledge-item:hover .file-actions {
  opacity: 1;
}

.file-actions .btn {
  padding: 4px 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.file-actions .btn:hover {
  color: var(--danger-color);
  background: rgba(220, 53, 69, 0.1);
}

.setting-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.setting-item:last-child {
  border-bottom: none;
}

.setting-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-color);
  font-weight: 500;
}

.setting-label input[type='checkbox'] {
  margin: 0;
  transform: scale(1.1);
  accent-color: var(--primary-color);
}

.delay-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-top: 6px;
  background: var(--card-bg);
}

.delay-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

.no-files {
  text-align: center;
  color: var(--text-muted);
  padding: 16px;
  font-size: 0.85rem;
  font-style: italic;
}

/* File Upload Modal Styles */
.file-help {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 4px;
  display: block;
}

.file-preview {
  background: var(--light-color);
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
}

.file-preview h4 {
  margin: 0 0 8px 0;
  font-size: 0.9rem;
  color: var(--text-color);
}

.file-preview p {
  margin: 2px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-group select,
.form-group input[type='file'] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--card-bg);
}

.form-group select:focus,
.form-group input[type='file']:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

/* Drag and Drop Styles */
.knowledge-card {
  position: relative;
  transition: var(--transition);
}

.knowledge-card.drag-over {
  border-color: var(--primary-color);
  background: rgba(37, 211, 102, 0.02);
  transform: scale(1.01);
}

.drag-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(37, 211, 102, 0.1);
  border: 2px dashed var(--primary-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  backdrop-filter: blur(2px);
}

.drag-content {
  text-align: center;
  color: var(--primary-color);
  padding: 20px;
}

.drag-content i {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.8;
}

.drag-content p {
  margin: 8px 0 4px 0;
  font-weight: 600;
  font-size: 1.1rem;
}

.drag-content small {
  font-size: 0.85rem;
  opacity: 0.8;
}

.no-files {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 16px;
  background: var(--light-color);
  border-radius: var(--radius-sm);
  margin: 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
}

.no-files i {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--primary-color);
  opacity: 0.6;
}

.no-files p {
  margin: 8px 0 4px 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.no-files small {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* File Upload Area */
.file-upload-area {
  position: relative;
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  background: var(--light-color);
  cursor: pointer;
  transition: var(--transition);
}

.file-upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(37, 211, 102, 0.02);
}

.file-upload-area.drag-over {
  border-color: var(--primary-color);
  background: rgba(37, 211, 102, 0.05);
  transform: scale(1.01);
}

.upload-content {
  cursor: pointer;
}

.upload-content i {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 12px;
  opacity: 0.7;
}

.upload-content p {
  margin: 8px 0 4px 0;
  color: var(--text-color);
  font-weight: 500;
}

.upload-content .file-help {
  margin-top: 8px;
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
  .mobile-navbar {
    display: block;
  }

  .dashboard-main {
    flex-direction: column;
    height: auto;
    padding-top: 0;
  }

  .dashboard-sidebar {
    display: none;
  }

  .conversations-panel {
    min-height: calc(100vh - 200px);
  }

  .stats-logs-panel {
    display: none;
  }
}

/* Responsive Design - Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .dashboard-main {
    flex-direction: column;
    height: auto;
  }

  .dashboard-sidebar {
    width: 100%;
  }

  .conversations-panel {
    min-height: 500px;
  }

  .stats-logs-panel {
    width: 100%;
    padding-left: 0;
    flex-direction: row;
    gap: 20px;
  }

  .stats-card,
  .logs-card {
    flex: 1;
  }
}

/* Loading overlay styles */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 8px;
}

.loading-spinner {
  text-align: center;
  color: var(--primary-color);
}

.loading-spinner i {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.loading-spinner p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .dashboard-main {
    padding: 10px 20px;
    gap: 10px;
  }

  .contacts-list {
    max-height: 200px;
  }

  .message {
    max-width: 85%;
  }

  /* Mobile-specific adjustments */
  .conversations-header {
    padding: 16px 20px;
  }

  .conversations-header h2 {
    font-size: 1.25rem;
  }

  .contact-item {
    padding: 12px 16px;
  }

  .contact-name {
    font-size: 0.9rem;
  }

  .contact-number {
    font-size: 0.8rem;
  }
}

/* ===================================== */
/* CONTACT MANAGEMENT EXCLUSIVE STYLES */
/* ===================================== */

/* Hide elements with x-show until Alpine.js initializes */
.dashboard [x-cloak] {
  display: none !important;
}

/* Using dashboard class - no custom container/main styles needed */

/* Compact stats summary - optimized for large screens */
.contact-main .stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 0; /* Remove margin, use gap from main */
  max-width: 800px; /* Limit width on large screens */
  margin-left: auto;
  margin-right: auto;
}

.contact-main .stat-card {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  padding: 16px 20px; /* Reduced from 24px */
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.contact-main .stat-card:hover {
  transform: translateY(-2px);
  box-shadow:
    var(--neuro-shadow-raised),
    0 8px 25px rgba(0, 0, 0, 0.1);
}

.contact-main .stat-icon {
  width: 48px; /* Reduced from 56px */
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--neuro-inset);
  color: var(--text-secondary);
  font-size: 1.25rem; /* Reduced from 1.5rem */
}

.contact-main .stat-icon.active {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.contact-main .stat-icon.paused {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.contact-main .stat-number {
  font-size: 1.75rem; /* Reduced from 2rem */
  font-weight: 700;
  color: var(--text-color);
  line-height: 1;
}

.contact-main .stat-label {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Modern Controls Section */
.contact-main .controls-section {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  padding: 24px;
  margin: 0;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Modern Search Bar */
.contact-main .modern-search {
  width: 100%;
}

.contact-main .search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--neuro-surface);
  border: 2px solid var(--primary-color);
  border-opacity: 0.2;
  border-radius: var(--radius-lg);
  transition: all 0.2s ease;
  overflow: hidden;
  box-shadow: var(--neuro-shadow-pressed);
  min-height: 52px;
}

.contact-main .search-input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.15),
    var(--neuro-shadow-raised);
  background: var(--bg-primary);
  transform: translateY(-1px);
}

.contact-main .search-input-wrapper:hover:not(:focus-within) {
  border-color: var(--primary-color);
  border-opacity: 0.4;
  box-shadow: var(--neuro-shadow-raised);
  transform: translateY(-1px);
}

.contact-main .search-icon {
  padding: 16px;
  color: var(--primary-color);
  font-size: 1.1rem;
  opacity: 0.8;
}

.contact-main .modern-search-input {
  flex: 1;
  padding: 16px 8px 16px 0;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  font-weight: 500;
}

.contact-main .modern-search-input::placeholder {
  color: var(--text-primary);
  opacity: 0.6;
  font-weight: 400;
}

.contact-main .clear-search-btn {
  padding: 16px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.contact-main .clear-search-btn:hover {
  color: var(--text-primary);
}

/* Filter Pills */
.contact-main .filter-pills {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.contact-main .filter-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--neuro-base);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-pressed);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
  justify-content: center;
}

.contact-main .filter-pill:hover {
  background: var(--neuro-raised);
  box-shadow: var(--neuro-shadow-raised);
  color: var(--text-primary);
}

.contact-main .filter-pill.active {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.contact-main .pill-count {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
}

.contact-main .filter-pill:not(.active) .pill-count {
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* Modern Sort Controls */
.contact-main .sort-controls-modern {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.contact-main .sort-dropdown {
  position: relative;
}

.contact-main .sort-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--neuro-base);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--neuro-shadow-pressed);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.contact-main .sort-trigger:hover {
  background: var(--neuro-raised);
  box-shadow: var(--neuro-shadow-raised);
}

.contact-main .sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--neuro-surface);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 8px;
  min-width: 140px;
  z-index: 10;
}

.contact-main .sort-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.contact-main .sort-option:hover {
  background: var(--neuro-raised);
}

.contact-main .sort-option.active {
  background: var(--primary-color);
  color: white;
}

.contact-main .sort-order-modern {
  padding: 12px;
  background: var(--neuro-base);
  border: none;
  border-radius: var(--radius-md);
  box-shadow: var(--neuro-shadow-pressed);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-main .sort-order-modern:hover {
  background: var(--neuro-raised);
  box-shadow: var(--neuro-shadow-raised);
  color: var(--primary-color);
}

.contact-main .search-box {
  flex: 1;
  position: relative;
}

.contact-main .search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.contact-main .search-input {
  width: 100%;
  padding: 12px 12px 12px 40px;
  border: 1px solid rgba(163, 168, 184, 0.2);
  border-radius: var(--radius-md);
  background: var(--neuro-inset);
  color: var(--text-color);
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

.contact-main .search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.contact-main .filter-select {
  padding: 12px 16px;
  border: 1px solid rgba(163, 168, 184, 0.2);
  border-radius: var(--radius-md);
  background: var(--neuro-inset);
  color: var(--text-color);
  font-size: 0.9rem;
  min-width: 150px;
}

/* Fixed contacts section - natural height with centered layout */
.contact-main .contacts-section {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  overflow: hidden;
  margin: 0 auto; /* Center the section */
  max-width: 1200px; /* Wider for contacts list but still contained */
}

.contact-main .contacts-list {
  max-height: 600px; /* Fixed reasonable height */
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Elegant neumorphic contact cards */
.contact-main .contact-item {
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised-sm);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  border: none;
  position: relative;
}

/* Clean scrollbar */

/* Keyframes removed - keeping it simple */

.contact-main .contact-item:hover {
  background: var(--neuro-raised);
  box-shadow: var(--neuro-shadow-raised);
  transform: translateY(-1px);
}

/* Enhanced glassmorphism on card hover */
.contact-main .contact-item:hover .status-badge.active {
  box-shadow:
    0 6px 20px rgba(34, 197, 94, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

.contact-main .contact-item:hover .status-badge.paused {
  box-shadow:
    0 6px 20px rgba(239, 68, 68, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}

/* Toggle updating state */
.contact-main .toggle-switch.updating {
  opacity: 0.7;
  pointer-events: none;
}

.contact-main .toggle-switch.updating .toggle-slider {
  position: relative;
}

.contact-main .updating-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 14px;
  color: var(--primary-color);
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Empty state actions */
.contact-main .empty-state-actions {
  margin-top: 20px;
}

.contact-main .empty-state-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--neuro-base);
  border: none;
  border-radius: 12px;
  box-shadow: var(--neuro-shadow-pressed);
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.contact-main .empty-state-actions .btn:hover {
  background: var(--neuro-raised);
  box-shadow: var(--neuro-shadow-raised);
  transform: translateY(-1px);
}

/* Remove unnecessary active state */

.contact-main .contact-item.paused {
  opacity: 0.6;
  background: rgba(239, 68, 68, 0.05);
}

.contact-main .contact-info {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.contact-main .contact-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--neuro-surface);
  box-shadow: var(--neuro-shadow-pressed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.contact-main .contact-details {
  flex: 1;
  min-width: 0;
}

.contact-main .contact-name {
  font-weight: 600;
  color: var(--text-color);
  font-size: 1rem;
  margin-bottom: 6px;
  line-height: 1.2;
}

.contact-main .contact-phone {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.3;
}

.contact-main .contact-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: right;
  min-width: 120px;
}

.contact-main .contact-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Glass effect for status badges */
.contact-main .status-badge {
  padding: 8px 16px;
  border-radius: 25px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  color: var(--text-secondary);
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.contact-main .status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(34, 197, 94, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  color: #16a34a;
  font-weight: 700;
  box-shadow:
    0 4px 15px rgba(34, 197, 94, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
  position: relative;
  overflow: hidden;
}

.contact-main .status-badge.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    45deg,
    transparent 30%,
    rgba(255, 255, 255, 0.1) 50%,
    transparent 70%
  );
  pointer-events: none;
}

/* Hover shimmer effect - triggers on card hover */
.contact-main .contact-item:hover .status-badge.active::before {
  animation: shimmer 1.5s ease-in-out infinite;
}

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

.contact-main .status-badge.paused {
  background: rgba(239, 68, 68, 0.15);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  color: #dc2626;
  font-weight: 700;
  box-shadow:
    0 4px 15px rgba(239, 68, 68, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.contact-main .btn-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--neuro-raised);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.9rem;
}

.contact-main .btn-icon:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-1px);
}

.contact-main .btn-icon.danger:hover {
  background: #ef4444;
}

/* Loading states - centered layout */
.contact-main .loading-section {
  text-align: center;
  padding: 60px 20px;
  background: var(--neuro-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--neuro-shadow-raised);
  margin: 0 auto; /* Center the section */
  max-width: 800px; /* Contained width */
}

.contact-main .loader {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(163, 168, 184, 0.2);
  border-top: 3px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

.contact-main .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  max-width: 800px; /* Contained width */
  margin: 0 auto; /* Center the section */
}

.contact-main .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* Responsive design */
@media (max-width: 768px) {
  .contact-main {
    padding: 10px 20px !important; /* Match Knowledge Base mobile padding */
  }

  /* Header responsive handled by existing .header-content styles */

  .contact-main .stats-summary {
    grid-template-columns: 1fr;
    gap: 12px;
    max-width: none; /* Full width on mobile */
    margin-left: 0;
    margin-right: 0;
  }

  .contact-main .search-filter {
    flex-direction: column;
    gap: 12px;
  }

  .contact-main .controls-section,
  .contact-main .contacts-section,
  .contact-main .loading-section,
  .contact-main .empty-state {
    max-width: none; /* Full width on mobile */
    margin-left: 0;
    margin-right: 0;
  }

  .contact-main .contacts-list {
    max-height: 400px; /* Reasonable height for mobile */
  }

  .contact-main .contact-item {
    padding: 16px;
    margin: 0 4px 8px 4px;
  }

  .contact-main .contacts-list {
    padding: 12px;
    gap: 8px;
  }

  .contact-main .contact-avatar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .contact-main .contact-meta {
    min-width: 100px;
    font-size: 0.75rem;
  }

  .contact-main .contact-meta {
    display: none;
  }
}

/* Mobile responsive for modern controls */
@media (max-width: 767px) {
  .contact-main .controls-section {
    padding: 16px;
    gap: 16px;
  }

  .contact-main .filter-pills {
    justify-content: center;
  }

  .contact-main .filter-pill {
    flex: 1;
    min-width: 60px;
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .contact-main .sort-controls-modern {
    justify-content: center;
  }

  .contact-main .search-input-wrapper {
    border-radius: var(--radius-md);
  }

  .contact-main .search-icon,
  .contact-main .clear-search-btn {
    padding: 14px;
  }

  .contact-main .modern-search-input {
    padding: 14px 8px 14px 0;
    font-size: 0.9rem;
  }
}

/* Tablet layout - intermediate max-widths */
@media (min-width: 769px) and (max-width: 1024px) {
  .contact-main .stats-summary {
    max-width: 700px; /* Slightly smaller on tablets */
  }

  .contact-main .controls-section {
    max-width: 900px; /* Adjusted for tablet */
  }

  .contact-main .contacts-section {
    max-width: 1000px; /* Slightly smaller on tablets */
  }

  .contact-main .loading-section,
  .contact-main .empty-state {
    max-width: 700px; /* Consistent with stats */
  }
}

/* CONTACT SUMMARY STYLES */
.contact-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 0;
}

.contact-stat {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}

.contact-stat:hover {
  background: var(--neuro-surface);
  transform: translateX(2px);
}

.contact-stat:nth-child(1) {
  border-left-color: var(--primary-color);
}

.contact-stat:nth-child(2) {
  border-left-color: var(--success-color);
}

.contact-stat:nth-child(3) {
  border-left-color: var(--warning-color);
}

.contact-stat i {
  font-size: 0.9rem;
  width: 16px;
  opacity: 0.8;
}

.contact-stat span {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.contact-stat strong {
  color: var(--text-primary);
  font-weight: 600;
}

.text-success {
  color: var(--success-color) !important;
}

.text-warning {
  color: var(--warning-color) !important;
}

/* Contact Details Page Specific Styles */

/* Status Badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-lead {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-prospect {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-active {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status-inactive {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f1b0b7;
}

.status-scheduled {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-tentative {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-visited {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status-draft {
  background-color: #e2e3e5;
  color: #383d41;
  border: 1px solid #d6d8db;
}

.status-sent {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-accepted {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.status-rejected {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f1b0b7;
}

.status-expired {
  background-color: #ffeaa7;
  color: #856404;
  border: 1px solid #fdcb6e;
}

/* Form Elements */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.input-group label {
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
}

.form-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Button sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

/* Empty state styling */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #666;
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* Contact Details Grid */
.client-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.info-item label {
  font-weight: 600;
  color: #666;
  font-size: 0.9rem;
}

.info-item span {
  color: #2c3e50;
}

/* Schedule and Quote Cards */
.schedule-card,
.quote-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  background: #f9f9f9;
  transition: box-shadow 0.2s ease;
}

.schedule-card:hover,
.quote-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.schedules-list,
.quotes-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* Form Actions */
.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  grid-column: 1 / -1;
}
