/* ==========================================================================
   Mara — Casa Playa Magma Design System
   Senior UI/UX Dark Luxury & Glassmorphism Theme
   ========================================================================== */

:root {
  /* Color Palette - Premium Nature & Luxury Dark Theme */
  --bg-canvas: #060b08;
  --bg-surface: #0c1410;
  --bg-card: rgba(16, 26, 21, 0.55);
  --bg-card-hover: rgba(24, 40, 32, 0.7);
  --bg-card-active: rgba(16, 185, 129, 0.15);
  
  --glass-bg: rgba(10, 18, 14, 0.75);
  --glass-border: rgba(255, 255, 255, 0.05);
  --glass-border-focus: rgba(16, 185, 129, 0.35);
  
  --accent-emerald: #10b981;
  --accent-emerald-light: #34d399;
  --accent-emerald-dark: #059669;
  --accent-glow: rgba(16, 185, 129, 0.15);
  
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-cyan: #06b6d4;

  /* Typography */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', var(--font-main);

  /* Text colors */
  --text-main: #f0fdf4;
  --text-muted: #8e9f96;
  --text-dim: #5c6c64;
  --text-inverse: #030705;

  /* Layout & Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.8);
  --shadow-glow: 0 0 40px rgba(16, 185, 129, 0.2);

  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-canvas: #f0f4f2;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(235, 246, 240, 0.95);
  --bg-card-active: rgba(5, 150, 105, 0.12);

  --glass-bg: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(5, 150, 105, 0.18);
  --glass-border-focus: rgba(5, 150, 105, 0.5);

  --accent-emerald: #059669;
  --accent-emerald-light: #10b981;
  --accent-emerald-dark: #047857;
  --accent-glow: rgba(5, 150, 105, 0.2);

  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  --accent-cyan: #0284c7;

  --text-main: #061e14;
  --text-muted: #3d5f50;
  --text-dim: #6c8e80;
  --text-inverse: #ffffff;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 45px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 30px rgba(5, 150, 105, 0.15);
}

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(16, 185, 129, 0.35);
}

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

.hidden {
  display: none !important;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-main);
  background-color: var(--bg-canvas);
  color: var(--text-main);
  line-height: 1.5;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glows */
.app-background-glow, .login-background-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  animation: orbFloat 10s infinite alternate ease-in-out;
}

.orb-top {
  top: -15%;
  left: 25%;
  width: 60vw;
  height: 50vh;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.6) 0%, transparent 80%);
}

.orb-1 {
  top: -20%;
  left: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.5) 0%, transparent 85%);
  animation-delay: 2s;
}

.orb-2 {
  bottom: -20%;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(5, 150, 105, 0.45) 0%, transparent 85%);
}

@keyframes orbFloat {
  0% { transform: translateY(0) scale(1); }
  100% { transform: translateY(20px) scale(1.05); }
}

/* ==========================================================================
   Login Page Styling
   ========================================================================== */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 30%, #0d1a14 0%, #040806 100%);
  padding: 1.5rem;
}

.login-container {
  width: 100%;
  max-width: 420px;
  z-index: 1;
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.25rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: cardFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-emerald), transparent);
}

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

.login-header {
  text-align: center;
  margin-bottom: 2.25rem;
}

.brand-avatar {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-dark) 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.35);
}

.avatar-letter {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-inverse);
  letter-spacing: -0.05em;
}

.pulse-ring {
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  border: 1.5px solid var(--accent-emerald);
  opacity: 0.3;
  animation: pulseRing 3.5s infinite ease-out;
}

@keyframes pulseRing {
  0% { transform: scale(0.95); opacity: 0.5; }
  70% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(0.95); opacity: 0; }
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.brand-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

.login-alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  background: rgba(244, 63, 94, 0.1);
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-md);
  color: #fda4af;
  font-size: 0.85rem;
  font-weight: 500;
  animation: shake 0.35s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1.15rem;
  font-size: 1rem;
  opacity: 0.65;
}

.input-wrapper input {
  width: 100%;
  padding: 0.9rem 1.15rem 0.9rem 2.85rem;
  background: rgba(4, 8, 6, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 3px var(--accent-glow);
  background: rgba(8, 14, 11, 0.95);
}

.toggle-password {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.toggle-password:hover {
  opacity: 1;
}

.login-button {
  width: 100%;
  padding: 0.95rem;
  margin-top: 0.75rem;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-dark) 100%);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-display);
  font-size: 0.975rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all var(--transition-normal);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

.login-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
  filter: brightness(1.08);
}

.login-button:active:not(:disabled) {
  transform: translateY(0);
}

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

.login-footer {
  margin-top: 2.25rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* ==========================================================================
   App Shell Layout
   ========================================================================== */
.shell {
  display: grid;
  grid-template-rows: 64px 1fr;
  grid-template-columns: 320px 1fr 340px;
  grid-template-areas:
    "topbar topbar topbar"
    "sidebar chat details";
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* ==========================================================================
   Header / Topbar
   ========================================================================== */
.topbar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-mark {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-dark) 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 850;
  font-size: 1.1rem;
  color: var(--text-inverse);
  position: relative;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.online-indicator {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  background-color: var(--accent-emerald-light);
  border: 1.5px solid var(--bg-canvas);
  border-radius: 50%;
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.brand-subtitle {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.system-pills {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.pill.ok {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald-light);
}

.pill.warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--accent-amber);
}

.pill.error {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.2);
  color: var(--accent-rose);
}

.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: currentColor;
}

.link-pill {
  text-decoration: none;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.link-pill:hover {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  margin-left: 0.4rem;
}

.user-avatar-small {
  font-size: 0.85rem;
}

.user-name {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-main);
}

.logout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.2);
  border-radius: var(--radius-pill);
  color: #fecdd3;
  font-size: 0.725rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(244, 63, 94, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   Sidebar / Conversation List
   ========================================================================== */
.sidebar {
  grid-area: sidebar;
  display: flex;
  flex-direction: column;
  background: rgba(8, 14, 11, 0.85);
  border-right: 1px solid var(--glass-border);
  overflow: hidden;
  width: 320px;
  height: 100%;
  min-height: 0;
}

.sidebar-head {
  padding: 1.25rem 1.25rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-head h1 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.icon-button {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.75rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  color: var(--accent-emerald-light);
  font-weight: 600;
  font-size: 0.775rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.icon-button:hover {
  background: var(--accent-emerald);
  color: var(--text-inverse);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.search-wrap {
  position: relative;
  padding: 0.5rem 1.25rem;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 2rem;
  font-size: 0.85rem;
  opacity: 0.4;
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.2rem;
  background: rgba(4, 8, 6, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--accent-emerald);
  background: rgba(8, 14, 11, 0.8);
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}

.conversation-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--glass-border);
}

.conversation-item.active {
  background: var(--bg-card-active);
  border-color: var(--glass-border-focus);
  position: relative;
}

.conversation-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  background-color: var(--accent-emerald);
  border-radius: 0 4px 4px 0;
}

.item-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10261c 0%, #06100b 100%);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-emerald-light);
  flex-shrink: 0;
}

.item-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.item-name {
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-time {
  font-size: 0.675rem;
  color: var(--text-dim);
  flex-shrink: 0;
}

.item-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-badge {
  font-size: 0.65rem;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  text-transform: uppercase;
  flex-shrink: 0;
}

.badge-auto { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald-light); }
.badge-assisted { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); }
.badge-human { background: rgba(6, 182, 212, 0.15); color: var(--accent-cyan); }

/* ==========================================================================
   Chat Panel
   ========================================================================== */
.chat-panel {
  grid-area: chat;
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
  position: relative;
  overflow: hidden;
  height: 100%;
  min-height: 0;
}

.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  gap: 1.25rem;
}

.empty-orbit {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  box-shadow: var(--shadow-glow);
}

.empty-state h2 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.empty-state p {
  max-width: 420px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.chat-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.chat-head {
  padding: 0.85rem 1.5rem;
  background: rgba(12, 20, 16, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.guest-profile-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.guest-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-dark) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-inverse);
  font-size: 0.95rem;
}

.guest-meta strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
}

.guest-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.processing {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.775rem;
  color: var(--accent-emerald-light);
  background: rgba(16, 185, 129, 0.08);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.message-list {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: radial-gradient(circle at center, rgba(16, 185, 129, 0.02) 0%, transparent 100%);
}

.message-bubble {
  max-width: 65%;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
  word-break: break-word;
  animation: bubbleFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.message-inbound {
  align-self: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
  color: var(--text-main);
}

.message-outbound {
  align-self: flex-end;
  background: linear-gradient(135deg, #0d281e 0%, #061711 100%);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-bottom-right-radius: 4px;
  color: var(--text-main);
}

.message-outbound.suggestion {
  border-style: dashed;
  background: rgba(245, 158, 11, 0.06);
  border-color: rgba(245, 158, 11, 0.3);
}

.message-media {
  max-width: 240px;
  max-height: 180px;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-bottom: 0.4rem;
  display: block;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.message-media:hover {
  transform: scale(1.02);
  filter: brightness(1.1);
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(3, 7, 5, 0.95);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn var(--transition-normal) ease-out;
}

.lightbox-modal.hidden {
  display: none !important;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: scale(0.95);
  animation: zoomIn var(--transition-normal) cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zoomIn {
  to { transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 2rem;
  color: var(--text-muted);
  font-size: 3rem;
  font-weight: 300;
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
  user-select: none;
  line-height: 1;
}

.lightbox-close:hover {
  color: var(--accent-rose);
  transform: scale(1.1);
}

/* Lightbox Navigation */
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 2rem;
  padding: 0.85rem 1.25rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  z-index: 100000;
  user-select: none;
}

.lightbox-nav:hover {
  background: var(--accent-emerald);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.lightbox-nav.hidden {
  display: none !important;
}

.nav-prev {
  left: 2rem;
}

.nav-next {
  right: 2rem;
}

.lightbox-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 100000;
  background: rgba(0, 0, 0, 0.5);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.lightbox-counter.hidden {
  display: none !important;
}

/* ==========================================================================
   Album Grid Layout
   ========================================================================== */
.album-grid {
  display: grid;
  gap: 4px;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-width: 280px;
  width: 100%;
}

.album-grid.grid-count-2 {
  grid-template-columns: repeat(2, 1fr);
  aspect-ratio: 1.5;
}

.album-grid.grid-count-3 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  aspect-ratio: 1.25;
}
.album-grid.grid-count-3 .album-img-wrapper:first-child {
  grid-column: span 2;
}

.album-grid.grid-count-4 {
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  aspect-ratio: 1;
}

.album-img-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  overflow: hidden;
}

.album-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.album-img-wrapper:hover img {
  transform: scale(1.04);
  filter: brightness(1.08);
}

.album-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  pointer-events: none;
}

.album-caption {
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-main);
  word-break: break-word;
}



.message-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  font-size: 0.675rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

.message-status-icon {
  font-size: 0.7rem;
  color: var(--accent-emerald-light);
}

.suggestion-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.btn-approve {
  padding: 0.35rem 0.75rem;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-dark) 100%);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-approve:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

/* Composer Panel */
.composer {
  padding: 1rem 1.5rem;
  background: rgba(8, 14, 11, 0.95);
  border-top: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.composer-mode {
  display: flex;
  gap: 0.4rem;
}

.compose-toggle {
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.compose-toggle.active {
  background: rgba(16, 185, 129, 0.15);
  border-color: var(--accent-emerald);
  color: var(--accent-emerald-light);
}

.composer-row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
}

.composer-row textarea {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(4, 8, 6, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.875rem;
  resize: none;
  max-height: 100px;
  line-height: 1.4;
  transition: border-color var(--transition-fast);
}

.composer-row textarea:focus {
  outline: none;
  border-color: var(--accent-emerald-light);
}

.send-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-dark) 100%);
  color: var(--text-inverse);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.2);
}

.send-button:hover {
  transform: scale(1.04) translateY(-1px);
  filter: brightness(1.08);
}

/* ==========================================================================
   Details Panel Styling
   ========================================================================== */
.details-panel {
  grid-area: details;
  background: rgba(8, 14, 11, 0.85);
  border-left: 1px solid var(--glass-border);
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 340px;
  height: 100%;
  min-height: 0;
}

.details-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  gap: 0.75rem;
}

.details-sun {
  font-size: 1.75rem;
  opacity: 0.5;
}

.details-header-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mode-switch {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  background: rgba(0, 0, 0, 0.35);
  padding: 0.2rem;
  border-radius: var(--radius-md);
}

.mode-btn {
  padding: 0.45rem;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.725rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn.active[data-mode="auto"] { background: var(--accent-emerald); color: var(--text-inverse); }
.mode-btn.active[data-mode="assisted"] { background: var(--accent-amber); color: var(--text-inverse); }
.mode-btn.active[data-mode="human"] { background: var(--accent-cyan); color: var(--text-inverse); }

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.badge-lifecycle {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-emerald-light);
}

.detail-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-main);
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--glass-border);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

.profile-chip {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
}

.chip-key {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
}

.chip-val {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 0.1rem;
}

.booking-requests {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.booking-card {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.775rem;
}

.booking-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.btn-approve-req {
  flex: 1;
  padding: 0.35rem;
  background: linear-gradient(135deg, var(--accent-emerald) 0%, var(--accent-emerald-dark) 100%);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.725rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-reject-req {
  flex: 1;
  padding: 0.35rem;
  background: rgba(244, 63, 94, 0.1);
  color: #fecdd3;
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 0.725rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-approve-req:hover { filter: brightness(1.1); }
.btn-reject-req:hover { background: rgba(244, 63, 94, 0.25); }

.calendar-summary {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cabin-avail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.75rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
}

/* ==========================================================================
   Dialog / Modal Styling
   ========================================================================== */
.glass-dialog {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 2.25rem;
  max-width: 440px;
  width: 90%;
  margin: auto;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
}

.glass-dialog::backdrop {
  background: rgba(3, 7, 5, 0.85);
  backdrop-filter: blur(10px);
}

.dialog-field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.15rem;
}

.dialog-field label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.dialog-field input, .dialog-field textarea {
  padding: 0.8rem;
  background: rgba(4, 8, 6, 0.8);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast);
}

.dialog-field input:focus, .dialog-field textarea:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

.dialog-actions {
  margin-top: 1.75rem;
  display: flex;
  justify-content: flex-end;
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity var(--transition-fast);
}

.dialog-close:hover { opacity: 1; }

/* ==========================================================================
   Toast Notification Styling
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card-hover);
  border: 1px solid var(--accent-emerald-light);
  border-radius: var(--radius-md);
  color: var(--text-main);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  z-index: 100;
  transition: all 0.3s ease;
  font-size: 0.85rem;
  font-weight: 500;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1024px) {
  .shell {
    grid-template-columns: 280px 1fr 280px;
  }
}

@media (max-width: 768px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 60px 1fr;
    grid-template-areas:
      "topbar"
      "chat";
  }
  .sidebar, .details-panel {
    display: none;
  }
  .system-pills .pill {
    display: none;
  }
}

/* ==========================================================================
   Admin Configurations Screen & Calendar
   ========================================================================== */
.config-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.config-btn:hover {
  background: rgba(16, 185, 129, 0.2);
  color: var(--accent-emerald-light);
  border-color: var(--accent-emerald);
  transform: rotate(30deg);
}

.config-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

.config-tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.config-tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.config-tab-btn.active {
  color: var(--accent-emerald-light);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.control-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.control-field select {
  padding: 0.5rem 1rem;
  background: rgba(4, 8, 6, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.control-field select:focus {
  border-color: var(--accent-emerald);
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-arrow-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.nav-arrow-btn:hover {
  background: var(--accent-emerald);
  color: var(--text-inverse);
}

.month-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  min-width: 120px;
  text-align: center;
}

.monthly-calendar-container {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--glass-border);
}

.calendar-days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 6px;
  column-gap: 6px;
}

.calendar-cell {
  aspect-ratio: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  position: relative;
  transition: all var(--transition-fast);
}

.calendar-cell.cell-empty {
  background: transparent;
  border: none;
  pointer-events: none;
}

.calendar-cell.cell-today {
  border-color: var(--accent-emerald-light);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.2);
}

.calendar-cell.cell-blocked {
  background: rgba(244, 63, 94, 0.2);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.calendar-cell.cell-pending {
  background: rgba(245, 158, 11, 0.2);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fef08a;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.calendar-cell:hover:not(.cell-empty) {
  filter: brightness(1.15);
  transform: scale(1.03);
}

.calendar-legend {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.legend-today { border: 1.5px solid var(--accent-emerald-light); }
.legend-blocked { background: rgba(244, 63, 94, 0.7); }
.legend-pending { background: rgba(245, 158, 11, 0.7); }

.ical-form-fields {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.ical-field-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ical-field-row label {
  font-size: 0.775rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.ical-field-row input {
  padding: 0.75rem 1rem;
  background: rgba(4, 8, 6, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  width: 100%;
  transition: all var(--transition-fast);
}

.ical-field-row input:focus {
  outline: none;
  border-color: var(--accent-emerald);
}

/* ==========================================================================
   Dialog & Modal Styling
   ========================================================================== */
.glass-dialog {
  background: rgba(13, 21, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: var(--text-main);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  max-width: 500px;
  width: 90%;
  margin: auto;
  position: relative;
  overflow: hidden;
}

.glass-dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.dialog-close:hover {
  color: var(--accent-emerald-light);
}

.dialog-field {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.dialog-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.dialog-field input, .dialog-field textarea {
  padding: 0.75rem 1rem;
  background: rgba(4, 8, 6, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}

.dialog-field input:focus, .dialog-field textarea:focus {
  border-color: var(--accent-emerald);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

/* ==========================================================================
   Cabins Toggle & AI Settings Styling
   ========================================================================== */
.config-tab-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.cabins-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.cabin-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.cabin-toggle-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
}

.cabin-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cabin-toggle-info strong {
  font-size: 0.95rem;
  color: var(--text-main);
}

.cabin-toggle-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cabin-status-tag {
  display: inline-block;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  width: fit-content;
}

.tag-active {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-emerald-light);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.tag-inactive {
  background: rgba(244, 63, 94, 0.15);
  color: #fda4af;
  border: 1px solid rgba(244, 63, 94, 0.3);
}

/* Toggle Switch Component */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--glass-border);
  transition: .3s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--accent-emerald);
  border-color: var(--accent-emerald-light);
}

input:checked + .toggle-slider:before {
  transform: translateX(22px);
}

/* AI Config Cards */
.ai-config-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.setting-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  gap: 1.5rem;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.setting-info strong {
  font-size: 0.925rem;
  color: var(--text-main);
}

.setting-info p {
  font-size: 0.775rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

.provider-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.85rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent-emerald-light);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  white-space: nowrap;
}

.model-select {
  padding: 0.5rem 1rem;
  background: rgba(4, 8, 6, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
  min-width: 180px;
}

.model-select:focus {
  border-color: var(--accent-emerald);
}

/* Token Metrics Cards */
.token-metrics-section {
  margin-top: 0.5rem;
}

.token-metrics-section h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
}

.token-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.metric-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  text-align: center;
}

.metric-label {
  font-size: 0.725rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.metric-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}

.metric-highlight {
  color: var(--accent-emerald-light);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Senior UI/UX Theme Toggle, Filter Chips & Responsive Drawer System
   ========================================================================== */

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 1.1rem;
  user-select: none;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-emerald);
  transform: scale(1.08) rotate(12deg);
}

.floating-theme-toggle {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.mobile-toggle-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  color: var(--text-main);
  font-size: 1.2rem;
  cursor: pointer;
  margin-right: 0.5rem;
  flex-shrink: 0;
}
.mobile-toggle-btn:hover {
  border-color: var(--accent-emerald);
}

.mobile-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 45;
  transition: opacity var(--transition-normal);
}

/* Filter Chips in Sidebar */
.filter-chips {
  display: flex;
  gap: 0.4rem;
  padding: 0.5rem 1.25rem 0.25rem;
  overflow-x: auto;
}

.filter-chip {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.filter-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}
.filter-chip.active {
  background: var(--accent-emerald);
  color: #ffffff;
  border-color: var(--accent-emerald-light);
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Responsive Media Queries */
@media (max-width: 900px) {
  .mobile-toggle-btn {
    display: inline-flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 320px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }

  .system-pills .pill {
    display: none;
  }
  .system-pills .pill#llm-model-pill {
    display: inline-flex;
  }

  .chat-panel {
    width: 100%;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 0.75rem 1rem;
  }
  .brand-subtitle {
    display: none;
  }
  .user-name {
    display: none;
  }
  .token-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}