.toaster-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: toastIn 0.3s ease;
  pointer-events: all;
  max-width: 380px;
}

.toast-success {
  background: #10b981;
  color: #fff;
}

.toast-error {
  background: #ef4444;
  color: #fff;
}

.toast-info {
  background: #4f46e5;
  color: #fff;
}

.toast-msg {
  flex: 1;
}

.toast-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  padding: 2px;
  display: flex;
}

.toast-close:hover {
  color: #fff;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
.login-page {
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  position: relative;
}

.login-page .theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  text-align: left;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 36px 32px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 60% at 50% -30%, rgba(34, 211, 238, 0.2), transparent);
  pointer-events: none;
}

.login-header {
  text-align: center;
  margin-bottom: 28px;
  position: relative;
}

.login-brand {
  margin: 0 auto 8px;
  filter: drop-shadow(0 0 16px rgba(255, 193, 7, 0.3));
}

.login-header h1 {
  font-family: "Syne", sans-serif;
  font-size: 26px;
  margin: 14px 0 4px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.login-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.login-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 0;
}

.login-form input {
  padding: 11px 14px;
  border: 1px solid var(--glass-border) !important;
  border-radius: 12px;
  font-size: 16px;
  background: var(--input-bg);
  color: var(--text);
  backdrop-filter: blur(8px);
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-dim), 0 0 20px var(--primary-dim);
}

.login-error {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: var(--danger);
  font-size: 14px;
}

.login-form .btn-block {
  width: 100%;
  margin-top: 8px;
  justify-content: center;
  padding: 12px;
  border-radius: 12px;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root,
[data-theme="dark"] {
  --primary: #22d3ee;
  --primary-light: #67e8f9;
  --primary-dim: rgba(34, 211, 238, 0.15);
  --success: #34d399;
  --danger: #f87171;
  --warn: #fbbf24;
  --bg: #070b14;
  --bg-soft: #0c1222;
  --surface: rgba(15, 23, 42, 0.55);
  --surface-solid: #111827;
  --text: #e8eef7;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --glass: rgba(15, 23, 42, 0.32);
  --glass-strong: rgba(30, 41, 59, 0.42);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-highlight: rgba(255, 255, 255, 0.08);
  --orb-1: #0891b2;
  --orb-2: #0f766e;
  --orb-3: #1d4ed8;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 14px;
  --chat-user: linear-gradient(135deg, rgba(8, 145, 178, 0.5), rgba(34, 211, 238, 0.32));
  --chat-assistant: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.07);
  --table-head: rgba(255, 255, 255, 0.04);
  --scrollbar: rgba(148, 163, 184, 0.3);
}

[data-theme="light"] {
  --primary: #0e7490;
  --primary-light: #0891b2;
  --primary-dim: rgba(8, 145, 178, 0.12);
  --success: #059669;
  --danger: #dc2626;
  --warn: #d97706;
  --bg: #dce6f2;
  --bg-soft: #e8eef6;
  --surface: rgba(255, 255, 255, 0.55);
  --surface-solid: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.16);
  --glass: rgba(255, 255, 255, 0.38);
  --glass-strong: rgba(255, 255, 255, 0.58);
  --glass-border: rgba(255, 255, 255, 0.75);
  --glass-highlight: rgba(255, 255, 255, 0.55);
  --orb-1: #67e8f9;
  --orb-2: #5eead4;
  --orb-3: #93c5fd;
  --shadow: 0 8px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --chat-user: linear-gradient(135deg, rgba(14, 116, 144, 0.78), rgba(8, 145, 178, 0.62));
  --chat-assistant: rgba(255, 255, 255, 0.42);
  --input-bg: rgba(255, 255, 255, 0.55);
  --table-head: rgba(15, 23, 42, 0.04);
  --scrollbar: rgba(15, 23, 42, 0.2);

  /* legacy aliases used across old CSS */
  --gray-50: var(--bg-soft);
  --gray-100: rgba(15, 23, 42, 0.05);
  --gray-200: var(--border);
  --gray-300: var(--border-strong);
  --gray-500: var(--text-muted);
  --gray-700: var(--text);
  --gray-900: var(--text);
}

[data-theme="dark"] {
  --gray-50: var(--bg-soft);
  --gray-100: rgba(255, 255, 255, 0.04);
  --gray-200: var(--border);
  --gray-300: var(--border-strong);
  --gray-500: var(--text-muted);
  --gray-700: var(--text);
  --gray-900: var(--text);
}

html {
  color-scheme: dark;
}

[data-theme="light"] {
  color-scheme: light;
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100svh;
  position: relative;
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  width: min(55vw, 520px);
  height: min(55vw, 520px);
  top: -12%;
  right: -8%;
  background: radial-gradient(circle, var(--orb-1), transparent 70%);
  opacity: 0.45;
  animation: drift 18s ease-in-out infinite alternate;
}

body::after {
  width: min(50vw, 480px);
  height: min(50vw, 480px);
  bottom: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--orb-2), transparent 70%);
  opacity: 0.35;
  animation: drift 22s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, -30px) scale(1.08); }
}

#root {
  position: relative;
  z-index: 1;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100svh;
}

.loading,
.error {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: var(--text);
}

.error {
  color: var(--danger);
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  padding: 18px 22px;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  display: block;
  object-fit: contain;
  user-select: none;
  flex-shrink: 0;
}

.header-logo {
  filter: drop-shadow(0 0 12px rgba(255, 193, 7, 0.25));
}

.header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: "Syne", sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-email {
  font-size: 13px;
  color: var(--text-muted);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px var(--primary-dim);
}

.tab-group {
  display: flex;
  gap: 4px;
  background: var(--glass);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border: none;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
}

.tab-btn.active {
  background: var(--primary-dim);
  color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.25);
}

.tab-btn:hover:not(.active) {
  color: var(--text);
}

/* Hosts */
.hosts-section h2,
.visits-section h2 {
  font-family: "Syne", sans-serif;
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text);
}

.hosts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.host-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.host-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(34, 211, 238, 0.35);
}

.host-info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.host-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--orb-2));
  color: #041016;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 0 20px var(--primary-dim);
}

[data-theme="light"] .host-avatar {
  color: #fff;
}

.host-info h3 {
  font-size: 16px;
  margin-bottom: 2px;
  font-family: "Syne", sans-serif;
}

.host-dept {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

.host-stats-row {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.host-stat {
  flex: 1;
  text-align: center;
  padding: 8px;
  background: var(--glass-highlight);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
}

.host-stat-num {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  font-family: "Syne", sans-serif;
}

.host-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #041016;
  box-shadow: 0 4px 16px var(--primary-dim);
}

[data-theme="light"] .btn-primary {
  color: #fff;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

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

.btn-success:hover {
  opacity: 0.9;
}

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

.btn-danger:hover {
  opacity: 0.9;
}

.btn-ghost {
  background: var(--glass);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  background: var(--glass-strong);
  color: var(--text);
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
}

.btn-icon:hover {
  color: var(--text);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal {
  background: var(--glass-strong);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  box-shadow: var(--shadow-lg);
  padding: 28px;
  width: 560px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-family: "Syne", sans-serif;
  color: var(--text);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.form-row label,
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.form-row label {
  margin-bottom: 0;
}

input,
select,
textarea {
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--input-bg);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Floating Chat Bubble */
.chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: linear-gradient(135deg, var(--primary), var(--orb-2));
  color: #041016;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px var(--primary-dim), 0 0 40px var(--primary-dim);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  backdrop-filter: blur(8px);
}

[data-theme="light"] .chat-fab {
  color: #fff;
}

.chat-fab:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 36px var(--primary-dim), 0 0 50px var(--primary-dim);
}

.chat-fab.open {
  background: var(--glass-strong);
  color: var(--text);
  box-shadow: var(--shadow);
}

/* Slide-out Chat Panel — glass shell */
.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  height: 580px;
  z-index: 999;
  opacity: 0;
  transform: translateY(24px) scale(0.94);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.chat-panel .chat-container {
  height: 100%;
  margin: 0;
}

@media (max-width: 480px) {
  .chat-panel {
    width: calc(100vw - 16px);
    right: 8px;
    bottom: 80px;
    height: 70vh;
  }
}

/* Visits Table */
.table-wrap {
  overflow-x: auto;
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  -webkit-overflow-scrolling: touch;
}

.visits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: transparent;
}

.visits-table th {
  text-align: left;
  padding: 12px 14px;
  background: var(--table-head);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.visits-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.visits-table tr:hover td {
  background: var(--glass-highlight);
}

.empty-msg {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.stats-page {
  margin-bottom: 32px;
}

@media (max-width: 768px) {
  .app {
    padding: 12px 12px 96px;
  }

  .header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 14px;
    margin-bottom: 18px;
  }

  .header-brand {
    gap: 10px;
  }

  .header-logo {
    height: 30px !important;
  }

  .header h1 {
    font-size: 17px;
  }

  .subtitle {
    font-size: 12px;
  }

  .header-right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .tab-group {
    width: 100%;
  }

  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 8px;
    font-size: 12px;
  }

  .header-user {
    width: 100%;
    justify-content: space-between;
    gap: 8px;
  }

  .header-email {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
  }

  .chat-fab {
    bottom: max(16px, env(safe-area-inset-bottom));
    right: max(16px, env(safe-area-inset-right));
    width: 54px;
    height: 54px;
  }

  .chat-panel,
  .chat-panel.open {
    top: max(10px, env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    bottom: calc(78px + env(safe-area-inset-bottom, 0px));
    width: auto;
    height: auto;
    transform: none;
  }

  .chat-panel:not(.open) {
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.98);
  }

  .chat-panel.open {
    opacity: 1;
    pointer-events: all;
    transform: none;
  }

  /* Card-style visits on mobile */
  .table-wrap {
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  .visits-table,
  .visits-table tbody {
    display: block;
    width: 100%;
  }

  .visits-table thead {
    display: none;
  }

  .visits-table tr {
    display: block;
    margin-bottom: 12px;
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--glass-border);
    background: var(--glass);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
  }

  .visits-table tr:hover td {
    background: transparent;
  }

  .visits-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    text-align: right;
  }

  .visits-table td:last-child {
    border-bottom: none;
    padding-top: 10px;
    justify-content: flex-end;
  }

  .visits-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    text-align: left;
    flex-shrink: 0;
  }

  .hosts-grid {
    grid-template-columns: 1fr;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal {
    width: calc(100vw - 24px);
    padding: 18px;
    max-height: min(90vh, 100dvh - 24px);
  }

  .modal-header h2 {
    font-size: 15px;
  }
}

@media (max-width: 380px) {
  .tab-btn span {
    display: none;
  }

  .logout-label {
    display: none;
  }

  .header-titles .subtitle {
    display: none;
  }
}
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(28px) saturate(1.6);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 0 0 1px rgba(34, 211, 238, 0.08),
    0 24px 48px rgba(0, 0, 0, 0.35),
    var(--shadow-lg);
  overflow: hidden;
  position: relative;
}

.chat-container::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -20%, rgba(34, 211, 238, 0.18), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(45, 212, 191, 0.12), transparent);
  pointer-events: none;
  z-index: 0;
}

.chat-container > * {
  position: relative;
  z-index: 1;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: var(--glass-strong);
  border-bottom: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  color: var(--text);
}

.chat-header svg:first-child {
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-dim));
}

.chat-header h2 {
  font-family: "Syne", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.chat-title-short {
  display: none;
}

.chat-title-full {
  display: inline;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}

.chat-bubble {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: bubble-in 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes bubble-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chat-bubble.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble.assistant {
  align-self: flex-start;
}

.bubble-icon {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.chat-bubble.user .bubble-icon {
  background: var(--chat-user);
  color: #fff;
}

.chat-bubble.assistant .bubble-icon {
  background: var(--glass-strong);
  color: var(--primary);
}

.bubble-body {
  min-width: 0;
}

.bubble-content {
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}

.chat-bubble.user .bubble-content {
  background: var(--chat-user);
  color: #fff;
  border-bottom-right-radius: 6px;
  border-color: rgba(255, 255, 255, 0.2);
}

.chat-bubble.assistant .bubble-content {
  background: var(--chat-assistant);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.bubble-content.error {
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--danger);
  background: rgba(248, 113, 113, 0.1);
}

.bubble-content.typing {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-style: italic;
}

.spin {
  animation: spin 1s linear infinite;
}

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

.model-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fff;
  margin-bottom: 6px;
  opacity: 0.95;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--glass-border);
  background: var(--glass-strong);
  backdrop-filter: blur(16px);
}

.chat-input input {
  flex: 1;
  padding: 11px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--input-bg);
  color: var(--text);
  backdrop-filter: blur(10px);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.chat-input input::placeholder {
  color: var(--text-dim);
}

.chat-input input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim), 0 0 24px var(--primary-dim);
}

.chat-input input:disabled {
  opacity: 0.6;
}

.chat-input button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #041016;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
  box-shadow: 0 4px 16px var(--primary-dim);
  flex-shrink: 0;
}

[data-theme="light"] .chat-input button {
  color: #fff;
}

.chat-input button:hover:not(:disabled) {
  transform: scale(1.05);
  filter: brightness(1.08);
}

.chat-input button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mic-btn {
  background: var(--glass-strong) !important;
  color: var(--primary) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: none !important;
}

.mic-btn:hover:not(:disabled) {
  background: var(--primary-dim) !important;
}

/* Recording overlay panel */
.voice-record-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 16px;
  border-top: 1px solid rgba(248, 113, 113, 0.35);
  background: linear-gradient(
    180deg,
    rgba(248, 113, 113, 0.12),
    var(--glass-strong)
  );
  backdrop-filter: blur(18px);
  overflow: hidden;
}

.voice-record-glow {
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  top: -60px;
  background: radial-gradient(circle, rgba(248, 113, 113, 0.35), transparent 70%);
  pointer-events: none;
  animation: voice-glow 2s ease-in-out infinite alternate;
}

@keyframes voice-glow {
  from { opacity: 0.55; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1.1); }
}

.voice-record-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.voice-rec-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.55);
  animation: rec-blink 1.1s ease-in-out infinite;
}

@keyframes rec-blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(248, 113, 113, 0.5); }
  50% { opacity: 0.55; box-shadow: 0 0 0 8px rgba(248, 113, 113, 0); }
}

.voice-rec-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--danger);
}

.voice-rec-timer {
  font-family: "Syne", sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  min-width: 42px;
  text-align: right;
}

.voice-waveform {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 36px;
}

.voice-waveform span {
  width: 3px;
  height: 10px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--danger), #fb923c);
  animation: wave-bar 0.9s ease-in-out infinite alternate;
}

@keyframes wave-bar {
  from { height: 8px; opacity: 0.55; }
  to { height: 32px; opacity: 1; }
}

.voice-record-hint {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.voice-record-actions {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  width: 100%;
}

.voice-cancel-btn,
.voice-stop-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--glass-border);
  transition: transform 0.15s, filter 0.15s;
}

.voice-cancel-btn {
  background: var(--glass);
  color: var(--text-muted);
}

.voice-cancel-btn:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.voice-stop-btn {
  background: linear-gradient(135deg, #ef4444, #f97316);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.3);
}

.voice-stop-btn:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.chat-container.is-recording .chat-messages {
  opacity: 0.72;
}

.voice-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  margin-right: 6px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.voice-toggle.on {
  color: var(--primary);
  background: var(--primary-dim);
}

.speak-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  background: var(--glass-strong);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.speak-btn:hover,
.speak-btn.active {
  color: var(--primary);
  border-color: rgba(34, 211, 238, 0.35);
}

.ws-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
}

.ws-status.on {
  background: rgba(52, 211, 153, 0.15);
  color: var(--success);
}

.ws-status.off {
  background: rgba(248, 113, 113, 0.15);
  color: var(--danger);
}

.bubble-content.booking-confirmed {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(52, 211, 153, 0.12);
}

.booking-icon {
  color: var(--success);
  margin-right: 6px;
  vertical-align: middle;
}

.chat-closed-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  background: rgba(52, 211, 153, 0.12);
  color: var(--success);
  font-size: 14px;
  font-weight: 600;
  backdrop-filter: blur(12px);
}

/* Markdown inside chat bubbles */
.bubble-content p {
  margin: 0 0 6px;
}

.bubble-content p:last-child {
  margin-bottom: 0;
}

.bubble-content strong {
  font-weight: 700;
}

.bubble-content em {
  font-style: italic;
}

.bubble-content ul,
.bubble-content ol {
  margin: 4px 0;
  padding-left: 18px;
}

.bubble-content li {
  margin: 2px 0;
}

.bubble-content code {
  background: rgba(255, 255, 255, 0.1);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.bubble-content pre {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 6px 0;
  overflow-x: auto;
  font-size: 12px;
}

[data-theme="light"] .bubble-content pre {
  background: rgba(15, 23, 42, 0.06);
}

.bubble-content pre code {
  background: none;
  padding: 0;
}

.bubble-content blockquote {
  border-left: 3px solid var(--primary);
  margin: 6px 0;
  padding: 2px 8px;
  color: var(--text-muted);
}

.bubble-content hr {
  border: none;
  border-top: 1px solid var(--glass-border);
  margin: 8px 0;
}

.bubble-content h1,
.bubble-content h2,
.bubble-content h3 {
  font-size: 14px;
  font-weight: 700;
  margin: 8px 0 4px;
  font-family: "Syne", sans-serif;
}

.bubble-content table {
  border-collapse: collapse;
  margin: 6px 0;
  font-size: 12px;
  width: 100%;
}

.bubble-content th,
.bubble-content td {
  border: 1px solid var(--glass-border);
  padding: 3px 6px;
  text-align: left;
}

.bubble-content th {
  background: var(--glass-highlight);
  font-weight: 600;
}

.chat-bubble.user .bubble-content code {
  background: rgba(255, 255, 255, 0.18);
}

.chat-bubble.user .bubble-content pre {
  background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .chat-title-full {
    display: none;
  }

  .chat-title-short {
    display: inline;
  }

  .chat-header {
    padding: 12px 14px;
    gap: 8px;
  }

  .chat-header h2 {
    font-size: 15px;
  }

  .chat-messages {
    padding: 12px 14px;
  }

  .chat-bubble {
    max-width: 92%;
  }

  .chat-input {
    padding: 10px 12px;
    gap: 8px;
  }

  .chat-input input,
  .chat-input button,
  .mic-btn {
    min-height: 44px;
  }

  .voice-record-panel {
    padding: 16px 14px 14px;
  }

  .voice-record-actions {
    flex-direction: column;
  }

  .voice-cancel-btn,
  .voice-stop-btn {
    width: 100%;
    min-height: 44px;
  }
}
pre code.hljs {
  display: block;
  overflow-x: auto;
  padding: 1em
}
code.hljs {
  padding: 3px 5px
}
/*!
  Theme: GitHub
  Description: Light theme as seen on github.com
  Author: github.com
  Maintainer: @Hirse
  Updated: 2021-05-15

  Outdated base version: https://github.com/primer/github-syntax-light
  Current colors taken from GitHub's CSS
*/
.hljs {
  color: #24292e;
  background: #ffffff
}
.hljs-doctag,
.hljs-keyword,
.hljs-meta .hljs-keyword,
.hljs-template-tag,
.hljs-template-variable,
.hljs-type,
.hljs-variable.language_ {
  /* prettylights-syntax-keyword */
  color: #d73a49
}
.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-title.function_ {
  /* prettylights-syntax-entity */
  color: #6f42c1
}
.hljs-attr,
.hljs-attribute,
.hljs-literal,
.hljs-meta,
.hljs-number,
.hljs-operator,
.hljs-variable,
.hljs-selector-attr,
.hljs-selector-class,
.hljs-selector-id {
  /* prettylights-syntax-constant */
  color: #005cc5
}
.hljs-regexp,
.hljs-string,
.hljs-meta .hljs-string {
  /* prettylights-syntax-string */
  color: #032f62
}
.hljs-built_in,
.hljs-symbol {
  /* prettylights-syntax-variable */
  color: #e36209
}
.hljs-comment,
.hljs-code,
.hljs-formula {
  /* prettylights-syntax-comment */
  color: #6a737d
}
.hljs-name,
.hljs-quote,
.hljs-selector-tag,
.hljs-selector-pseudo {
  /* prettylights-syntax-entity-tag */
  color: #22863a
}
.hljs-subst {
  /* prettylights-syntax-storage-modifier-import */
  color: #24292e
}
.hljs-section {
  /* prettylights-syntax-markup-heading */
  color: #005cc5;
  font-weight: bold
}
.hljs-bullet {
  /* prettylights-syntax-markup-list */
  color: #735c0f
}
.hljs-emphasis {
  /* prettylights-syntax-markup-italic */
  color: #24292e;
  font-style: italic
}
.hljs-strong {
  /* prettylights-syntax-markup-bold */
  color: #24292e;
  font-weight: bold
}
.hljs-addition {
  /* prettylights-syntax-markup-inserted */
  color: #22863a;
  background-color: #f0fff4
}
.hljs-deletion {
  /* prettylights-syntax-markup-deleted */
  color: #b31d28;
  background-color: #ffeef0
}
.hljs-char.escape_,
.hljs-link,
.hljs-params,
.hljs-property,
.hljs-punctuation,
.hljs-tag {
  /* purposely ignored */
  
}.stats-container {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
  padding: 24px;
}

.stats-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.stats-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.stats-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-family: "Syne", sans-serif;
  color: var(--text);
}

.stats-header h2 svg {
  color: var(--primary);
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: var(--glass-strong);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-value {
  font-size: 20px;
  font-weight: 700;
  font-family: "Syne", sans-serif;
  color: var(--text);
  line-height: 1.2;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.stats-section {
  margin-bottom: 24px;
}

.stats-section h3 {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.stats-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--table-head);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.stats-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.stats-table tr:hover td {
  background: var(--glass-highlight);
}

.stats-table code {
  background: var(--glass-highlight);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
}

.tier-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
}

.truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 20px !important;
}

.bubble-body {
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .stats-cards {
    grid-template-columns: 1fr 1fr;
  }
}

.stats-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.live-banner {
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.3);
  border-radius: 10px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--success);
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease;
}

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