:root {
  --lixus-primary: #058880;
  --lixus-light: #72C8B7;
  --lixus-dark: #043E3B;
  --accent-gold: #E1B025;
  --accent-sky: #5AB4E5;
  --accent-charcoal: #333333;
  --bg-soft: #f0f4f8;
  --sidebar-width: 280px;
  --card-radius: 1.5rem;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  font-family: 'Roboto', sans-serif;
  background-color: var(--bg-soft);
  color: var(--accent-charcoal);
  display: flex;
  min-height: 100vh;
  overflow: hidden;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background: var(--lixus-dark);
  color: white;
  display: flex;
  flex-direction: column;
  padding: 2rem 1.5rem;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
}

.sidebar-header {
  margin-bottom: 3rem;
  text-align: center;
}

.sidebar-header h1 {
  font-family: 'Cabin', sans-serif;
  font-size: 1.8rem;
  color: var(--lixus-light);
  letter-spacing: 1px;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nav-item {
  padding: 1rem 1.5rem;
  border-radius: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.nav-item.active {
  background: var(--lixus-primary);
  color: white;
  box-shadow: 0 4px 15px rgba(5, 136, 128, 0.3);
}

/* Main Content Area */
.main-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
  height: 100vh;
}

.view-section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.view-section.active {
  display: block;
}

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

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.header-row h2 {
  font-family: 'Cabin', sans-serif;
  font-size: 2rem;
  color: var(--lixus-dark);
}

/* Cards */
.card {
  background: white;
  border-radius: var(--card-radius);
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
}

/* Tables */
.table-container {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th {
  text-align: left;
  padding: 1rem;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  font-weight: 600;
}

td {
  padding: 1rem;
  border-bottom: 1px solid #e2e8f0;
}

tr:hover td {
  background: #f1f5f9;
}

/* Badges */
.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #166534; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-danger { background: #fee2e2; color: #991b1b; }

.text-success { color: #166534; font-weight: 600; }
.text-warning { color: #854d0e; font-weight: 600; }
.text-danger { color: #991b1b; font-weight: 600; }
.text-info { color: #0369a1; font-weight: 600; }

/* Grid for Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
}

.qr-card {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.qr-placeholder {
  background: #f8fafc;
  padding: 3rem;
  border-radius: 1.5rem;
  margin: 1.5rem 0;
  border: 2px dashed #cbd5e1;
}

/* Logs */
.logs-wrapper {
  background: #1e293b;
  color: #f8fafc;
  padding: 1.5rem;
  border-radius: 1rem;
  height: 450px;
  overflow-y: auto;
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
}

.log-entry {
  margin-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
}

.log-time { color: var(--lixus-light); margin-right: 0.5rem; }
.log-sender { color: var(--accent-sky); font-weight: bold; }

/* Settings Form */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  font-size: 1rem;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
}

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

.btn-primary:hover {
  background: var(--lixus-dark);
  transform: translateY(-2px);
}

.btn-danger {
  background: #ea4335;
  color: white;
}

.btn-danger:hover {
  background: #c5221f;
  transform: translateY(-2px);
}

/* Spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(0,0,0,0.1);
  border-top-color: var(--lixus-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Bot Selector Styles */
.bot-selector-wrapper {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.bot-option {
  padding: 1.25rem;
  border: 2px solid #e2e8f0;
  border-radius: 1rem;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  background: #f8fafc;
}

.bot-option:hover {
  border-color: var(--lixus-light);
  background: white;
}

.bot-option.active {
  border-color: var(--lixus-primary);
  background: #f0fdfa;
  box-shadow: 0 4px 12px rgba(5, 136, 128, 0.1);
}

.bot-option.active::after {
  content: '✓ Active';
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--lixus-primary);
  background: white;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  border: 1px solid var(--lixus-primary);
}

.bot-name {
  font-weight: 700;
  display: block;
  font-size: 1.1rem;
  color: var(--lixus-dark);
  margin-bottom: 0.25rem;
}

.bot-desc {
  font-size: 0.85rem;
  opacity: 0.7;
  line-height: 1.4;
}

.bot-card {
    min-height: 300px;
}

/* Auth Gate Styles */
.auth-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 62, 59, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(10px);
}

.auth-card {
  background: white;
  padding: 3rem;
  border-radius: 2rem;
  width: 100%;
  max-width: 450px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalScale {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.auth-icon {
  width: 64px;
  height: 64px;
  color: var(--lixus-primary);
  margin-bottom: 1.5rem;
}

.auth-card h2 {
  font-family: 'Cabin', sans-serif;
  margin-bottom: 1rem;
  color: var(--lixus-dark);
}

.auth-card p {
  color: #64748b;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Notifications */
.notification-container {
  position: fixed;
  top: 2rem;
  right: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  z-index: 10000;
}

.notification {
  padding: 1.25rem 2rem;
  border-radius: 1rem;
  background: white;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 300px;
  animation: slideIn 0.4s ease;
  border-left: 6px solid var(--lixus-primary);
}

.notification-danger { border-left-color: #ea4335; }
.notification-warning { border-left-color: #f1c40f; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notification-content h4 {
  font-size: 0.9rem;
  margin-bottom: 2px;
  color: #1e293b;
}

.notification-content p {
  font-size: 0.8rem;
  color: #64748b;
}
