:root {
  --mh-primary: #0f766e;
  --mh-primary-dark: #0d5f59;
  --mh-accent: #14b8a6;
  --mh-bg: #f0fdfa;
  --mh-surface: #ffffff;
  --mh-text: #0f172a;
  --mh-muted: #64748b;
  --mh-border: #e2e8f0;
  --mh-sidebar: #0b1324;
  --mh-sidebar-hover: #132447;
  --mh-radius: 12px;
  --mh-shadow: 0 10px 40px rgba(15, 23, 42, 0.08);
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--mh-text);
  background: linear-gradient(180deg, #ecfeff 0%, var(--mh-bg) 40%, #f8fafc 100%);
  min-height: 100vh;
}

.navbar-mh {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mh-border);
}

.btn-mh-primary {
  background: linear-gradient(135deg, var(--mh-primary), var(--mh-accent));
  border: none;
  color: #fff;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.55rem 1.25rem;
}

.btn-mh-primary:hover {
  background: linear-gradient(135deg, var(--mh-primary-dark), var(--mh-primary));
  color: #fff;
}

.btn-mh-outline {
  border-radius: 999px;
  border: 1px solid var(--mh-primary);
  color: var(--mh-primary);
  font-weight: 600;
}

.hero-gradient {
  background: radial-gradient(1200px 500px at 10% -20%, rgba(20, 184, 166, 0.35), transparent),
    radial-gradient(800px 400px at 90% 0%, rgba(59, 130, 246, 0.2), transparent),
    linear-gradient(180deg, #f0fdfa 0%, #ffffff 100%);
}

.feature-card {
  border: 1px solid var(--mh-border);
  border-radius: var(--mh-radius);
  background: var(--mh-surface);
  box-shadow: var(--mh-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 50px rgba(15, 23, 42, 0.12);
}

.section-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #ccfbf1;
  color: var(--mh-primary-dark);
  font-size: 0.85rem;
  font-weight: 600;
}

.footer-mh {
  border-top: 1px solid var(--mh-border);
  background: #fff;
}

/* Admin layout */
.admin-shell {
  min-height: 100vh;
  display: flex;
  background: #f1f5f9;
}

.admin-sidebar {
  width: 260px;
  background: var(--mh-sidebar);
  color: #e2e8f0;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar .brand {
  padding: 1.25rem 1.25rem 0.5rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.admin-sidebar .nav-link {
  color: #cbd5e1;
  border-radius: 8px;
  margin: 0.15rem 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.92rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: var(--mh-sidebar-hover);
  color: #fff;
}

.admin-content {
  flex: 1;
  min-width: 0;
}

.admin-topbar {
  background: #fff;
  border-bottom: 1px solid var(--mh-border);
  padding: 1rem 1.5rem;
}

.stat-card {
  border: none;
  border-radius: var(--mh-radius);
  box-shadow: var(--mh-shadow);
}

.table thead th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--mh-muted);
}

/* Chat thread — conversational layout */
.chat-shell {
  border: 1px solid var(--mh-border);
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--mh-shadow);
}

.chat-scroll {
  min-height: 320px;
  max-height: min(58vh, 520px);
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.chat-empty-state {
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.chat-turn {
  margin-bottom: 1.25rem;
}

.chat-msg-row {
  display: flex;
  width: 100%;
  margin-bottom: 0.35rem;
}

.chat-msg-row--user {
  justify-content: flex-end;
}

.chat-msg-row--bot {
  justify-content: flex-start;
  align-items: flex-end;
  gap: 0.5rem;
}

.chat-msg-user-block {
  max-width: min(88%, 420px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-msg-bot-block {
  max-width: min(88%, 440px);
  min-width: 0;
}

.chat-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.chat-avatar--bot {
  background: linear-gradient(145deg, var(--mh-primary), var(--mh-accent));
  color: #fff;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.35);
}

.chat-bubble {
  padding: 0.75rem 1rem;
  line-height: 1.5;
  font-size: 0.95rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.chat-bubble-user {
  background: linear-gradient(165deg, #e0f2fe 0%, #dbeafe 100%);
  border-radius: 1rem 1rem 0.25rem 1rem;
  color: #0f172a;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble-bot {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.25rem 1rem 1rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-msg-meta {
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  margin-top: 0.35rem;
}

.chat-msg-meta.text-end {
  margin-top: 0.25rem;
}

.chat-details {
  color: var(--mh-muted);
}

.chat-details summary {
  cursor: pointer;
  user-select: none;
  color: var(--mh-muted);
}

.chat-details summary:hover {
  color: var(--mh-primary);
}

.chat-details[open] summary {
  margin-bottom: 0.25rem;
}

.chat-typing-inner {
  background: #fff;
  border: 1px solid var(--mh-border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.chat-composer-bar {
  transition: box-shadow 0.2s ease;
}

.chat-composer-bar:focus-within {
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08) !important;
}

.chat-input-field {
  min-height: 2.75rem;
  resize: none;
  max-height: 7.5rem;
  padding: 0.65rem 0.9rem;
}

.chat-side-sticky {
  position: sticky;
  top: 0.5rem;
}

.chat-side-card {
  border-radius: 1rem;
  border: 1px solid var(--mh-border);
  background: #fff;
  padding: 1rem 1.1rem;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
}

.chat-side-card--muted {
  background: rgba(255, 255, 255, 0.85);
}

.chat-side-card__head {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mh-muted);
  margin-bottom: 0.5rem;
}

.chat-tips-list li {
  margin-bottom: 0.35rem;
}

.chat-tips-list li:last-child {
  margin-bottom: 0;
}

#chat-alert {
  border-color: #bae6fd !important;
  background: #f0f9ff !important;
  color: #0c4a6e !important;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mh-primary);
  animation: mh-chat-bounce 1.2s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes mh-chat-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}
