@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Brand (preserved) */
  --wa-bg: #111b21;
  --wa-panel: #202c33;
  --wa-panel-hover: #2a3942;
  --wa-border: #222e35;
  --wa-divider: rgba(134, 150, 160, 0.15);
  --wa-text: #e9edef;
  --wa-text-muted: #8696a0;
  --wa-primary: #00a884;
  --wa-primary-hover: #06d755;
  --wa-danger: #f15c6d;
  --wa-warning: #ffbc2c;
  --wa-font: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --wa-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Ant foundations (layout only, colors mapped to brand) */
  --ant-space-1: 4px;
  --ant-space-2: 8px;
  --ant-space-3: 12px;
  --ant-space-4: 16px;
  --ant-space-6: 24px;
  --ant-space-8: 32px;
  --ant-radius-sm: 6px;
  --ant-radius-md: 8px;
  --ant-radius-lg: 12px;
  --ant-radius-xl: 16px;
  --ant-text-xs: 12px;
  --ant-text-sm: 14px;
  --ant-text-md: 16px;
  --ant-text-lg: 20px;
  --ant-text-xl: 24px;
  --ant-text-xxl: 32px;
  --ant-focus: 0 0 0 2px var(--wa-bg), 0 0 0 4px var(--wa-primary);
  --ant-hit-min: 44px;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--wa-font);
  color: var(--wa-text);
  background-color: var(--wa-bg);
  line-height: 1.5;
}

/* App Shell Layout */
.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Typography */
h1, h2, h3, h4, p {
  margin: 0;
}

h1 {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--wa-text);
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 24px;
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wa-primary);
  margin-bottom: 12px;
  display: block;
}

a {
  color: var(--wa-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Cards & Panels */
.panel {
  background: var(--wa-panel);
  border-radius: 16px;
  padding: 32px;
  border: 1px solid var(--wa-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-card {
  background: var(--wa-panel);
  border-radius: 16px;
  padding: 48px;
  margin-bottom: 32px;
  border: 1px solid var(--wa-border);
  border-left: 4px solid var(--wa-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-copy {
  color: var(--wa-text-muted);
  font-size: 1.125rem;
  max-width: 700px;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  margin-top: 24px;
  padding: 8px 16px;
  border-radius: 8px;
  background: rgba(0, 168, 132, 0.1);
  color: var(--wa-primary);
  font-size: 0.875rem;
  font-weight: 500;
}

/* Forms & Inputs */
.stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--wa-text-muted);
}

input {
  width: 100%;
  padding: 14px 16px;
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  color: var(--wa-text);
  font-family: var(--wa-font);
  font-size: 1rem;
  transition: all 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--wa-primary);
  box-shadow: 0 0 0 2px rgba(0, 168, 132, 0.2);
}

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

.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--wa-text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle svg {
  width: 18px;
  height: 18px;
  transition: color 0.2s;
}

.password-toggle:hover svg {
  color: var(--wa-text);
}

/* Spinners and Toasts */
@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
  margin-right: 8px;
}

.button.is-loading {
  opacity: 0.8;
  cursor: not-allowed;
  pointer-events: none;
}

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 1000;
}

.toast {
  background: var(--wa-panel);
  color: var(--wa-text);
  border-left: 4px solid var(--wa-danger);
  padding: 16px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideIn 0.3s ease-out forwards;
  max-width: 350px;
  font-size: 0.9375rem;
}

.toast.success {
  border-left-color: var(--wa-primary);
}

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Buttons */
.button-row {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 99px;
  font-family: var(--wa-font);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
}

.button.primary {
  background: var(--wa-primary);
  color: #111b21;
}

.button.primary:hover {
  background: var(--wa-primary-hover);
  transform: translateY(-1px);
}

.button.secondary {
  background: transparent;
  color: var(--wa-primary);
  border: 1px solid var(--wa-primary);
}

.button.secondary:hover {
  background: rgba(0, 168, 132, 0.1);
}

.button.google {
  background: white;
  color: #111b21;
  width: 100%;
}

.button.google:hover {
  background: #f8f9fa;
}

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

.button.ghost:hover {
  color: var(--wa-text);
  background: var(--wa-panel-hover);
}

.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Auth Layout */
.auth-grid {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 40px;
  align-items: center;
}

.auth-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  height: 100%;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex-grow: 1;
  width: 1px;
  background: var(--wa-divider);
}

.auth-divider span {
  padding: 16px 0;
  color: var(--wa-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
}

.hint {
  color: var(--wa-text-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

/* Control Panel Layout */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
}

.account-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.info-box {
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  padding: 24px;
}

.info-label {
  color: var(--wa-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 12px;
}

.info-value {
  font-size: 1.125rem;
  font-weight: 500;
  color: var(--wa-text);
}

.code {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--wa-primary);
  font-size: 0.9375rem;
  word-break: break-all;
  background: rgba(0, 168, 132, 0.1);
  padding: 6px 10px;
  border-radius: 8px;
  display: inline-block;
  border: 1px solid rgba(0, 168, 132, 0.2);
}

.api-key-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.code.blurred {
  filter: blur(5px);
  user-select: none;
  transition: filter 0.3s;
  cursor: pointer;
}

.code.blurred:hover {
  filter: blur(0);
  user-select: auto;
}

.icon-button {
  background: none;
  border: none;
  color: var(--wa-text-muted);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.icon-button:hover {
  background: var(--wa-panel-hover);
  color: var(--wa-text);
  border-color: var(--wa-border);
}

.icon-button svg {
  width: 18px;
  height: 18px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
}

.status-card, .qr-card {
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  border-radius: 16px;
  padding: 24px;
}

.status-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--wa-divider);
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 99px;
  background: var(--wa-border);
  color: var(--wa-text);
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pill.active {
  background: rgba(0, 168, 132, 0.1);
  color: var(--wa-primary);
}

.status-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.status-row span {
  color: var(--wa-text-muted);
  font-size: 0.9375rem;
}

.status-row strong {
  color: var(--wa-text);
  font-weight: 500;
}

/* QR Code Section */
.qr-frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: var(--wa-panel);
  border-radius: 12px;
  margin: 24px 0;
  border: 2px dashed var(--wa-border);
  padding: 24px;
}

.qr-placeholder {
  color: var(--wa-text-muted);
  font-size: 0.9375rem;
  text-align: center;
  line-height: 1.5;
}

#qrCanvas {
  max-width: 100%;
  border-radius: 12px;
  background: white;
  padding: 12px;
}

/* Docs Specific Styles */
.docs-grid {
  display: grid;
  gap: 24px;
}

.doc-card {
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 16px;
  padding: 32px;
}

.doc-card h2 {
  margin-bottom: 16px;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.doc-list-item {
  display: flex;
  align-items: flex-start;
  color: var(--wa-text-muted);
  line-height: 1.6;
}

.doc-list-item::before {
  content: "•";
  color: var(--wa-primary);
  font-weight: bold;
  margin-right: 12px;
}

.endpoint {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  color: var(--wa-text);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-right: 8px;
}

.endpoint.get { border-left: 3px solid var(--wa-primary); }
.endpoint.post { border-left: 3px solid #3498db; }

pre {
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  color: var(--wa-text);
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 860px) {
  .auth-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  
  .auth-divider {
    flex-direction: row;
    height: auto;
    gap: 16px;
  }
  
  .auth-divider::before,
  .auth-divider::after {
    height: 1px;
    width: auto;
  }

  .account-strip {
    grid-template-columns: 1fr;
  }

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

/* Sidebar & Unified Layout */
:root {
  --sidebar-width: 280px;
}

.with-sidebar {
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--wa-panel);
  border-right: 1px solid var(--wa-border);
  position: fixed;
  top: 0;
  bottom: 0;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--wa-primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111b21;
  font-weight: 800;
  font-size: 1.2rem;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--wa-text);
  letter-spacing: -0.02em;
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nav-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--wa-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
  padding-left: 12px;
}

.nav-link {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--wa-text-muted);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: all 0.2s;
  text-decoration: none !important;
}

.nav-link:hover {
  background: var(--wa-panel-hover);
  color: var(--wa-text);
}

.nav-link.active {
  background: rgba(0, 168, 132, 0.1);
  color: var(--wa-primary);
}

.main-content {
  margin-left: var(--sidebar-width);
  flex-grow: 1;
  max-width: calc(100% - var(--sidebar-width));
  padding: 40px 60px;
}

/* Glassmorphism Cards */
.glass-card {
  background: rgba(32, 44, 51, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 32px;
  transition: all 0.3s ease;
}

.glass-card:hover {
  border-color: rgba(0, 168, 132, 0.2);
  transform: translateY(-2px);
}

/* Stats Styling */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.stat-item {
  padding: 24px;
  background: var(--wa-panel);
  border-radius: 16px;
  border: 1px solid var(--wa-border);
}

.stat-label {
  font-size: 0.75rem;
  color: var(--wa-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--wa-text);
}

@media (max-width: 1024px) {
  .sidebar { display: none; }
  .main-content { margin-left: 0; max-width: 100%; padding: 32px 20px; }
}

/* Documentation Content Styling */
.doc-section {
  margin-bottom: 80px;
  scroll-margin-top: 40px;
}

.doc-section h1 {
  font-size: 2.75rem;
  margin-bottom: 24px;
}

.doc-section h2 {
  font-size: 1.75rem;
  margin-top: 48px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.doc-section p {
  font-size: 1.125rem;
  color: var(--wa-text-muted);
  max-width: 800px;
  line-height: 1.7;
  margin-bottom: 32px;
}

/* Feature Grid */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 48px;
}

.feature-card {
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
}

.icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

/* Code Snippets */
.code-block {
  position: relative;
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  margin: 24px 0;
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--wa-border);
  background: rgba(255, 255, 255, 0.02);
}

.code-lang {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--wa-text-muted);
  text-transform: uppercase;
}

.copy-btn {
  background: none;
  border: 1px solid var(--wa-border);
  color: var(--wa-text-muted);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: var(--wa-panel-hover);
  color: var(--wa-text);
  border-color: var(--wa-primary);
}

/* Endpoint Styling */
.endpoint-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.method {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.method.post { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.method.get { background: rgba(0, 168, 132, 0.2); color: var(--wa-primary); }

.url {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9375rem;
  color: var(--wa-text);
}

/* Error Table */
.error-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 12px;
  overflow: hidden;
}

.error-table th, .error-table td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--wa-border);
}

.error-table th {
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wa-text-muted);
}

.error-table code {
  background: var(--wa-bg);
  padding: 4px 8px;
  border-radius: 6px;
  color: var(--wa-primary);
}

/* Chatbot Widget Styles */
.chat-widget-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--wa-primary);
  color: #111b21;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  z-index: 999;
  transition: transform 0.2s, background 0.2s;
  border: none;
}

.chat-widget-btn:hover {
  transform: scale(1.05);
  background: var(--wa-primary-hover);
}

.chat-window {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 350px;
  height: 450px;
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 1000;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.chat-window.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.chat-header {
  padding: 16px;
  background: var(--wa-bg);
  border-bottom: 1px solid var(--wa-border);
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--wa-text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-close-btn {
  background: none;
  border: none;
  color: var(--wa-text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.chat-close-btn:hover {
  color: var(--wa-text);
}

.chat-body {
  flex-grow: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.9375rem;
  line-height: 1.4;
  word-wrap: break-word;
}

.chat-message.bot {
  background: var(--wa-bg);
  color: var(--wa-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  background: rgba(0, 168, 132, 0.1);
  color: var(--wa-primary);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  border: 1px solid rgba(0, 168, 132, 0.2);
}

.chat-footer {
  padding: 16px;
  border-top: 1px solid var(--wa-border);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex-grow: 1;
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  color: var(--wa-text);
  padding: 10px 14px;
  border-radius: 99px;
  font-size: 0.9375rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--wa-primary);
}

.chat-send-btn {
  background: var(--wa-primary);
  color: #111b21;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.chat-send-btn:hover {
  background: var(--wa-primary-hover);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--wa-text-muted);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

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

/* Premium Sign Out Button */
.logout-btn {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
  transition: all 0.2s;
}

.logout-btn:hover {
  background: rgba(231, 76, 60, 0.1) !important;
  color: #e74c3c !important;
}

/* Auth Split Layout */
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 520px;
  max-width: 960px;
  margin: 0 auto;
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
}

.auth-hero {
  background: linear-gradient(135deg, #0d1b14 0%, #1a2d22 50%, #0f1f17 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.auth-hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(0, 168, 132, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 60%, rgba(0, 168, 132, 0.04) 0%, transparent 50%);
  pointer-events: none;
}

.auth-hero-content {
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.auth-hero-icon {
  width: 56px;
  height: 56px;
  background: var(--wa-primary);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111b21;
  font-weight: 800;
  font-size: 1.5rem;
  margin-bottom: 28px;
}

.auth-hero h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--wa-text);
  margin: 0 0 16px;
  line-height: 1.3;
}

.auth-hero-tagline {
  font-size: 0.9375rem;
  color: var(--wa-text-muted);
  line-height: 1.7;
  margin: 0 0 36px;
}

.auth-hero-features {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-hero-feature {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.875rem;
  color: var(--wa-text);
}

.auth-hero-feature svg {
  width: 18px;
  height: 18px;
  color: var(--wa-primary);
  flex-shrink: 0;
}

.auth-form-col {
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  color: var(--wa-text);
}

.auth-brand p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--wa-text-muted);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--wa-text-muted);
  font-size: 0.8125rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--wa-divider);
}

.link-btn {
  background: none;
  border: none;
  color: var(--wa-primary);
  font-family: var(--wa-font);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 4px 0;
  transition: opacity 0.2s;
}

.link-btn:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Mobile: Stack auth-split vertically */
@media (max-width: 860px) {
  .auth-split {
    grid-template-columns: 1fr;
    max-width: 440px;
    min-height: auto;
  }

  .auth-hero {
    display: none;
  }

  .auth-form-col {
    padding: 36px 28px;
  }
}

/* Insight Cards */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.insight-card {
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 0.2s, transform 0.2s;
}

.insight-card:hover {
  border-color: rgba(0, 168, 132, 0.2);
  transform: translateY(-1px);
}

.insight-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.insight-icon svg {
  width: 20px;
  height: 20px;
}

.insight-icon-send {
  background: rgba(0, 168, 132, 0.12);
  color: var(--wa-primary);
}

.insight-icon-check {
  background: rgba(52, 152, 219, 0.12);
  color: #3498db;
}

.insight-icon-clock {
  background: rgba(241, 196, 15, 0.12);
  color: #f1c40f;
}

.insight-icon-expired {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
}

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

.insight-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--wa-text);
  line-height: 1.2;
}

.insight-value.shimmer {
  width: 40px;
  height: 28px;
  background: var(--wa-border);
  border-radius: 6px;
  animation: shimmer 1.5s infinite linear;
  background-image: linear-gradient(90deg, var(--wa-border) 0px, var(--wa-panel-hover) 40px, var(--wa-border) 80px);
  background-size: 80px 100%;
}

.insight-label {
  font-size: 0.75rem;
  color: var(--wa-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
  margin-top: 4px;
}

/* Section Groups */
.section-group {
  margin-top: 40px;
}

.section-group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-group-header h3 {
  margin: 0;
  font-size: 1.25rem;
}

/* Data Table */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--wa-border);
  border-radius: 14px;
  background: var(--wa-panel);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead {
  background: rgba(255, 255, 255, 0.02);
}

.data-table th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--wa-text-muted);
  border-bottom: 1px solid var(--wa-border);
  white-space: nowrap;
}

.data-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--wa-divider);
  color: var(--wa-text);
  vertical-align: middle;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.data-table .table-empty {
  text-align: center;
  color: var(--wa-text-muted);
  padding: 40px 18px;
}

/* Status Badges in Table */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.badge-verified {
  background: rgba(0, 168, 132, 0.12);
  color: var(--wa-primary);
}

.badge-pending {
  background: rgba(241, 196, 15, 0.12);
  color: #f1c40f;
}

.badge-expired {
  background: rgba(231, 76, 60, 0.12);
  color: #e74c3c;
}

.badge-unverified {
  background: rgba(134, 150, 160, 0.12);
  color: var(--wa-text-muted);
}

/* Skeleton Loading */
@keyframes shimmer {
  0% { background-position: -80px 0; }
  100% { background-position: 80px 0; }
}

.skeleton-row {
  padding: 8px 0;
}

.skeleton-line {
  display: block;
  height: 14px;
  background: var(--wa-border);
  border-radius: 6px;
  animation: shimmer 1.5s infinite linear;
  background-image: linear-gradient(90deg, var(--wa-border) 0px, var(--wa-panel-hover) 40px, var(--wa-border) 80px);
  background-size: 80px 100%;
}

/* Mobile Sidebar Toggle */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 200;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--wa-panel);
  border: 1px solid var(--wa-border);
  color: var(--wa-text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.sidebar-toggle:hover {
  background: var(--wa-panel-hover);
}

.sidebar-toggle svg {
  width: 20px;
  height: 20px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
}

.sidebar-overlay.open {
  opacity: 1;
}

/* Responsive: Tablet */
@media (max-width: 1024px) {
  .sidebar-toggle { display: flex; }
  .sidebar-overlay { display: block; pointer-events: none; }
  .sidebar-overlay.open { pointer-events: auto; }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 101;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 32px 20px;
  }

  .insight-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsive: Mobile */
@media (max-width: 640px) {
  .insight-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .insight-card {
    padding: 16px;
    gap: 12px;
  }

  .insight-icon {
    width: 36px;
    height: 36px;
  }

  .insight-icon svg {
    width: 16px;
    height: 16px;
  }

  .insight-value {
    font-size: 1.25rem;
  }

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

  .auth-panel {
    padding: 28px 20px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 0.8125rem;
  }

  .main-content {
    padding: 24px 16px;
  }

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

/* Code Monospace Font in Table */
.data-table code {
  font-family: var(--wa-mono);
  font-size: 0.8125rem;
  background: rgba(0, 168, 132, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--wa-primary);
}

/* ============================================
   Ant enterprise layer (layout/system only,
   brand colors preserved)
   ============================================ */

/* Type scale: 12/14/16/20/24/32 */
h1 { font-size: var(--ant-text-xxl); line-height: 1.25; letter-spacing: -0.02em; }
h2 { font-size: var(--ant-text-xl); line-height: 1.3; }
h3 { font-size: var(--ant-text-lg); line-height: 1.4; }
body, p, .hint { font-size: var(--ant-text-sm); }
.stat-value, .insight-value { font-size: var(--ant-text-xl); font-variant-numeric: tabular-nums; }
pre, code, .code, .url, .endpoint { font-family: var(--wa-mono); }

/* Rhythm: 4/8/12/16/24/32 */
.main-content { padding: var(--ant-space-8) var(--ant-space-8); }
.doc-section { margin-bottom: var(--ant-space-8); }
.doc-section p { margin-bottom: var(--ant-space-6); font-size: var(--ant-text-md); }
.stack { gap: var(--ant-space-4); }
.dashboard-grid, .stats-grid, .insight-grid, .feature-grid { gap: var(--ant-space-4); }
.panel, .glass-card, .stat-item, .insight-card { padding: var(--ant-space-6); border-radius: var(--ant-radius-xl); }
.button-row { gap: var(--ant-space-3); }

/* Unified card anatomy: header / body / footer */
.glass-card > h3:first-child, .stat-item > .stat-label:first-child { margin-bottom: var(--ant-space-2); }

/* Buttons: explicit states, min hit area */
.button { min-height: var(--ant-hit-min); border-radius: var(--ant-radius-lg); font-size: var(--ant-text-sm); }
.button:focus-visible, .nav-link:focus-visible, .icon-button:focus-visible,
.copy-btn:focus-visible, input:focus-visible, .chat-widget-btn:focus-visible,
.sidebar-toggle:focus-visible, .link-btn:focus-visible {
  outline: none;
  box-shadow: var(--ant-focus);
}
.button.primary:active { transform: translateY(0); filter: brightness(0.96); }
.button.secondary:active { background: rgba(0,168,132,0.16); }
.icon-button { min-width: var(--ant-hit-min); min-height: var(--ant-hit-min); border-radius: var(--ant-radius-md); }
.nav-link { min-height: var(--ant-hit-min); display: flex; align-items: center; border-radius: var(--ant-radius-md); }
.copy-btn { min-height: 32px; }

/* Inputs: default / hover / focus-visible / disabled / error */
input:hover { border-color: var(--wa-text-muted); }
input:disabled { opacity: 0.6; cursor: not-allowed; }
input[aria-invalid="true"] { border-color: var(--wa-danger); box-shadow: 0 0 0 2px rgba(241,92,109,0.2); }
label { font-size: var(--ant-text-sm); gap: var(--ant-space-2); }

/* Table: data-dense enterprise */
.table-container { border-radius: var(--ant-radius-lg); }
.data-table th { font-size: var(--ant-text-xs); padding: var(--ant-space-3) var(--ant-space-4); position: sticky; top: 0; }
.data-table td { padding: var(--ant-space-3) var(--ant-space-4); font-size: var(--ant-text-sm); }
.data-table tbody tr:focus-within, .data-table tbody tr:focus-visible { outline: 2px solid var(--wa-primary); outline-offset: -2px; }
.table-empty { font-size: var(--ant-text-sm); }
.table-error { color: var(--wa-danger); }

/* Status pill + badges: explicit variants */
.pill { font-size: var(--ant-text-xs); padding: 6px var(--ant-space-3); border: 1px solid transparent; }
.pill[data-state="connected"], .pill.active { background: rgba(0,168,132,0.12); color: var(--wa-primary); border-color: rgba(0,168,132,0.3); }
.pill[data-state="qr_ready"], .pill[data-state="initializing"], .pill[data-state="reconnecting"] { background: rgba(255,188,44,0.12); color: var(--wa-warning); border-color: rgba(255,188,44,0.3); }
.pill[data-state="relink_required"], .pill[data-state="failed"] { background: rgba(241,92,109,0.12); color: var(--wa-danger); border-color: rgba(241,92,109,0.3); }
.badge { font-size: var(--ant-text-xs); border: 1px solid transparent; }
.badge-verified { border-color: rgba(0,168,132,0.3); }
.badge-pending { border-color: rgba(241,196,15,0.3); }
.badge-expired { border-color: rgba(231,76,60,0.3); }

/* Empty / loading / error */
.qr-placeholder { font-size: var(--ant-text-sm); }
.skeleton-line { border-radius: var(--ant-radius-sm); }

/* Toast: role=alert styling */
.toast { border-radius: var(--ant-radius-md); font-size: var(--ant-text-sm); max-width: 380px; }
.toast.success { border-left-color: var(--wa-primary); }
.toast[role="alert"] { border-left-width: 4px; }

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--wa-primary); color: #111b21; padding: var(--ant-space-2) var(--ant-space-4); border-radius: 0 0 var(--ant-radius-md) 0; font-weight: 700; z-index: 9999; }
.skip-link:focus { left: 0; }

/* Sidebar: consistent 4/8/12/16 rhythm */
.sidebar { padding: var(--ant-space-8) var(--ant-space-6); gap: var(--ant-space-8); }
.nav-group { gap: var(--ant-space-2); }
.nav-label { padding-left: var(--ant-space-3); margin-bottom: var(--ant-space-1); font-size: var(--ant-text-xs); }

/* Chat: focus + hit areas */
.chat-input { font-size: var(--ant-text-sm); }
.chat-send-btn { width: var(--ant-hit-min); height: var(--ant-hit-min); }
.chat-send-btn:focus-visible, .chat-close-btn:focus-visible { outline: none; box-shadow: var(--ant-focus); }

/* Responsive defaults */
@media (max-width: 1024px) {
  .main-content { padding: var(--ant-space-6) var(--ant-space-4); }
  .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1, .doc-section h1 { font-size: var(--ant-text-xl); }
  .main-content { padding: var(--ant-space-4) var(--ant-space-4); }
}

/* Reduced motion: no decorative motion without purpose */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Pairing (phone-number linking) — second method next to QR */
.link-tabs {
  display: flex;
  gap: var(--ant-space-2);
  background: var(--wa-bg);
  border: 1px solid var(--wa-border);
  border-radius: var(--ant-radius-lg);
  padding: var(--ant-space-1);
  margin-bottom: var(--ant-space-4);
  width: 100%;
}
.link-tab {
  flex: 1;
  min-height: var(--ant-hit-min);
  border: none;
  border-radius: var(--ant-radius-md);
  background: transparent;
  color: var(--wa-text-muted);
  font-family: var(--wa-font);
  font-size: var(--ant-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.link-tab:hover { color: var(--wa-text); }
.link-tab.active { background: var(--wa-panel-hover); color: var(--wa-text); }
.link-tab:focus-visible { outline: none; box-shadow: var(--ant-focus); }
.pair-code-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--ant-space-3);
  margin-top: var(--ant-space-2);
}
.pair-code {
  font-size: var(--ant-text-xl);
  letter-spacing: 0.2em;
  padding: var(--ant-space-3) var(--ant-space-4);
}
.pair-steps {
  margin: var(--ant-space-4) 0 0;
  padding-left: 20px;
  color: var(--wa-text-muted);
  font-size: var(--ant-text-sm);
  line-height: 1.7;
  text-align: left;
}
.pill[data-state="pairing_ready"] { background: rgba(255,188,44,0.12); color: var(--wa-warning); border-color: rgba(255,188,44,0.3); }
