/* ==========================================================================
   IngatWA Design Tokens & Components
   Soft UI Evolution · Teal productivity palette · Plus Jakarta Sans
   ========================================================================== */

:root {
  /* Brand */
  --color-primary: #0d9488;
  --color-primary-hover: #0f766e;
  --color-primary-soft: #ccfbf1;
  --color-primary-muted: #f0fdfa;
  --color-secondary: #14b8a6;
  --color-accent: #ea580c;
  --color-accent-hover: #c2410c;
  --color-accent-soft: #ffedd5;

  /* Surfaces */
  --color-bg: #f0fdfa;
  --color-bg-canvas: #f8fafc;
  --color-surface: #ffffff;
  --color-surface-elevated: #ffffff;
  --color-muted: #e8f1f4;
  --color-border: #e2e8f0;
  --color-border-teal: #99f6e4;

  /* Text */
  --color-fg: #134e4a;
  --color-fg-strong: #0f172a;
  --color-fg-muted: #64748b;
  --color-fg-inverse: #ffffff;

  /* Semantic */
  --color-success: #10b981;
  --color-success-soft: #d1fae5;
  --color-warning: #f59e0b;
  --color-warning-soft: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-soft: #fee2e2;
  --color-info: #0ea5e9;
  --color-info-soft: #e0f2fe;
  --color-premium: #7c3aed;
  --color-premium-soft: #ede9fe;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.06), 0 2px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 40px rgba(13, 148, 136, 0.1), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-accent: 0 8px 24px rgba(234, 88, 12, 0.2);
  --shadow-primary: 0 8px 24px rgba(13, 148, 136, 0.2);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --sidebar-width: 260px;
  --topbar-height: 64px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --duration: 200ms;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --duration: 0ms;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  color: var(--color-fg-strong);
  background: var(--color-bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-fg);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.25rem;
  border-radius: var(--radius-md);
  padding: 0.625rem 1.125rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease),
    color var(--duration) var(--ease), border-color var(--duration) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-accent) 0%, #f97316 100%);
  color: var(--color-fg-inverse);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-accent-hover) 0%, var(--color-accent) 100%);
  color: var(--color-fg-inverse);
}

.btn-secondary {
  background: var(--color-primary);
  color: var(--color-fg-inverse);
  box-shadow: var(--shadow-primary);
}

.btn-secondary:hover {
  background: var(--color-primary-hover);
  color: var(--color-fg-inverse);
}

.btn-outline {
  background: var(--color-surface);
  border-color: var(--color-border);
  color: var(--color-fg-strong);
  box-shadow: var(--shadow-xs);
}

.btn-outline:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--color-fg-muted);
}

.btn-ghost:hover {
  background: var(--color-muted);
  color: var(--color-fg-strong);
}

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

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

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.875rem 1.5rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-elevated {
  box-shadow: var(--shadow-md);
  border-color: transparent;
}

.card-interactive {
  transition: box-shadow var(--duration) var(--ease),
    transform var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.card-interactive:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-teal);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-fg-strong);
  margin-bottom: 0.375rem;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--color-fg-muted);
  margin-top: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 0.875rem;
  color: var(--color-fg-strong);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.625rem 0.875rem;
  transition: border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.form-input:hover,
.form-select:hover,
.form-textarea:hover {
  border-color: #cbd5e1;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #94a3b8;
}

/* --------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-success {
  background: var(--color-success-soft);
  color: #047857;
}

.badge-warning {
  background: var(--color-warning-soft);
  color: #b45309;
}

.badge-danger {
  background: var(--color-danger-soft);
  color: #b91c1c;
}

.badge-info {
  background: var(--color-info-soft);
  color: #0369a1;
}

.badge-neutral {
  background: #f1f5f9;
  color: #475569;
}

.badge-primary {
  background: var(--color-primary-soft);
  color: var(--color-primary-hover);
}

.badge-premium {
  background: var(--color-premium-soft);
  color: #6d28d9;
}

.badge-accent {
  background: var(--color-accent-soft);
  color: var(--color-accent-hover);
}

/* --------------------------------------------------------------------------
   KPI cards
   -------------------------------------------------------------------------- */

.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--duration) var(--ease);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
}

.kpi-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-teal {
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

.kpi-icon-orange {
  background: var(--color-accent-soft);
  color: var(--color-accent);
}

.kpi-icon-green {
  background: var(--color-success-soft);
  color: var(--color-success);
}

.kpi-icon-blue {
  background: var(--color-info-soft);
  color: var(--color-info);
}

.kpi-icon-purple {
  background: var(--color-premium-soft);
  color: var(--color-premium);
}

.kpi-icon-amber {
  background: var(--color-warning-soft);
  color: var(--color-warning);
}

/* --------------------------------------------------------------------------
   App shell
   -------------------------------------------------------------------------- */

.app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--color-bg-canvas);
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 40;
  transition: transform var(--duration) var(--ease);
}

.sidebar-brand {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.nav-section {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
  padding: 0.75rem 0.75rem 0.375rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-fg-muted);
  text-decoration: none;
  transition: background var(--duration) var(--ease),
    color var(--duration) var(--ease);
  cursor: pointer;
  margin-bottom: 2px;
}

.nav-link:hover {
  background: var(--color-primary-muted);
  color: var(--color-primary-hover);
}

.nav-link.active {
  background: linear-gradient(135deg, var(--color-primary-soft), #e0f2fe);
  color: var(--color-primary-hover);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
}

.nav-link svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-link.active svg {
  opacity: 1;
}

.nav-link .nav-badge {
  margin-left: auto;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.375rem;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.25rem;
  text-align: center;
  background: var(--color-danger-soft);
  color: #b91c1c;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-border);
}

.main-area {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: var(--topbar-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 30;
}

.page-content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

/* Chat ke bot CTA */
.chat-bot-card {
  background: linear-gradient(145deg, #0f766e 0%, #0d9488 55%, #14b8a6 100%);
  box-shadow: var(--shadow-primary);
  overflow: visible;
}

.chat-bot-card--compact {
  padding: 1rem 1.125rem;
  border-radius: var(--radius-lg);
}

.chat-bot-card__icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.75rem 1.125rem;
  border-radius: var(--radius-md);
  border: none;
  background: #ffffff !important;
  color: #115e59 !important;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.25rem;
  text-decoration: none !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
  cursor: pointer;
  transition: background var(--duration) var(--ease),
    transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.btn-whatsapp:hover {
  background: #f0fdfa !important;
  color: #0f766e !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.14);
}

.btn-whatsapp:active {
  transform: scale(0.98);
}

.btn-whatsapp svg,
.btn-whatsapp .wa-inline-icon {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  color: #25d366;
  fill: currentColor;
}

/* Floating WhatsApp button (mobile backup) */
.wa-fab {
  position: fixed;
  z-index: 50;
  right: max(0.875rem, env(safe-area-inset-right, 0px));
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  display: inline-flex !important;
  align-items: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0.75rem 1.125rem 0.75rem 0.875rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
  color: #ffffff !important;
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none !important;
  box-shadow:
    0 8px 28px rgba(18, 140, 126, 0.45),
    0 2px 8px rgba(15, 23, 42, 0.12);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  pointer-events: auto;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}

.wa-fab:hover,
.wa-fab:focus-visible {
  color: #ffffff !important;
  box-shadow:
    0 12px 32px rgba(18, 140, 126, 0.5),
    0 4px 12px rgba(15, 23, 42, 0.14);
}

.wa-fab:active {
  transform: scale(0.96);
}

.wa-fab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
}

.wa-fab__icon svg {
  display: block;
}

.wa-fab__label {
  padding-right: 0.125rem;
}

/* Mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  z-index: 35;
}

.sidebar-overlay.open {
  display: block;
}

@media (max-width: 1023px) {
  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-area {
    margin-left: 0;
  }

  .page-content {
    /* Extra bottom space so last content tidak tertutup FAB + browser bar */
    padding: 1rem 1rem calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }

  .page-header .btn {
    width: 100%;
  }
}

/* Desktop: hide FAB (already gated with lg:hidden utility; belt-and-suspenders) */
@media (min-width: 1024px) {
  .wa-fab {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
}

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

.data-table thead {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
}

.data-table th {
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--color-fg-muted);
  white-space: nowrap;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  color: var(--color-fg-strong);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--duration) var(--ease);
}

.data-table tbody tr:hover {
  background: var(--color-primary-muted);
}

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

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-top: 1rem;
  padding: 0.25rem 0;
}

.pagination-meta {
  font-size: 0.8125rem;
  color: var(--color-fg-muted);
}

.pagination-meta strong {
  color: var(--color-fg-strong);
  font-weight: 600;
}

.pagination-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: var(--radius-md, 0.5rem);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-fg-muted);
  text-decoration: none;
  border: 1px solid transparent;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.pagination-page:hover {
  background: var(--color-primary-muted, #ecfeff);
  color: var(--color-primary-hover, #0e7490);
}

.pagination-page.is-active {
  background: var(--color-primary, #0891b2);
  color: #fff;
  border-color: var(--color-primary, #0891b2);
  pointer-events: none;
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 2rem;
  color: var(--color-fg-muted);
  font-size: 0.875rem;
  user-select: none;
}

/* --------------------------------------------------------------------------
   Quota meter
   -------------------------------------------------------------------------- */

.quota-track {
  height: 8px;
  background: #e2e8f0;
  border-radius: var(--radius-full);
  overflow: hidden;
}

.quota-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  transition: width 400ms var(--ease);
}

.quota-fill.warning {
  background: linear-gradient(90deg, var(--color-warning), #fbbf24);
}

.quota-fill.danger {
  background: linear-gradient(90deg, var(--color-danger), #f87171);
}

/* --------------------------------------------------------------------------
   Page header
   -------------------------------------------------------------------------- */

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-fg-strong);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--color-fg-muted);
  margin-top: 0.25rem;
}

/* --------------------------------------------------------------------------
   Avatar
   -------------------------------------------------------------------------- */

.avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-primary-soft), #a5f3fc);
  color: var(--color-primary-hover);
}

.avatar-sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.625rem;
}

.avatar-lg {
  width: 3rem;
  height: 3rem;
  font-size: 0.875rem;
}

/* --------------------------------------------------------------------------
   Status pulse
   -------------------------------------------------------------------------- */

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  position: relative;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--color-success);
  opacity: 0.4;
  animation: pulse-ring 1.5s var(--ease) infinite;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 0.5;
  }
  100% {
    transform: scale(1.8);
    opacity: 0;
  }
}

.pulse-dot.offline {
  background: var(--color-danger);
}

.pulse-dot.offline::after {
  background: var(--color-danger);
}

.pulse-dot.pending {
  background: var(--color-warning);
}

.pulse-dot.pending::after {
  background: var(--color-warning);
}

/* --------------------------------------------------------------------------
   Marketing / Landing
   -------------------------------------------------------------------------- */

.hero-mesh {
  background:
    radial-gradient(ellipse 80% 60% at 20% 40%, rgba(13, 148, 136, 0.18), transparent),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(234, 88, 12, 0.1), transparent),
    radial-gradient(ellipse 50% 40% at 60% 80%, rgba(20, 184, 166, 0.12), transparent),
    linear-gradient(180deg, #f0fdfa 0%, #f8fafc 100%);
}

.chat-bubble {
  max-width: 280px;
  padding: 0.75rem 1rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  line-height: 1.45;
  box-shadow: var(--shadow-sm);
}

.chat-bubble-user {
  background: #dcf8c6;
  border-bottom-right-radius: 0.25rem;
  margin-left: auto;
}

.chat-bubble-bot {
  background: white;
  border: 1px solid var(--color-border);
  border-bottom-left-radius: 0.25rem;
}

.feature-icon {
  width: 3rem;
  height: 3rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary-soft);
  color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   Auth layout
   -------------------------------------------------------------------------- */

.auth-panel {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.15), transparent),
    linear-gradient(145deg, #0d9488 0%, #0f766e 50%, #115e59 100%);
}

/* --------------------------------------------------------------------------
   QR mock
   -------------------------------------------------------------------------- */

.qr-frame {
  width: 220px;
  height: 220px;
  background: white;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  box-shadow: var(--shadow-md);
  position: relative;
}

.qr-frame::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: calc(var(--radius-lg) + 4px);
  border: 2px dashed var(--color-primary);
  opacity: 0.35;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Variable chips
   -------------------------------------------------------------------------- */

.var-chip {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  background: var(--color-primary-muted);
  color: var(--color-primary-hover);
  border: 1px solid var(--color-border-teal);
  cursor: pointer;
  transition: background var(--duration) var(--ease);
}

.var-chip:hover {
  background: var(--color-primary-soft);
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--color-fg-strong);
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 300ms var(--ease);
  max-width: 360px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --------------------------------------------------------------------------
   Empty state
   -------------------------------------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-fg-muted);
}

.empty-state-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius-xl);
  background: var(--color-primary-muted);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Tabs
   -------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.25rem;
  overflow-x: auto;
}

.tab {
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-fg-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  font-family: var(--font);
  white-space: nowrap;
  transition: color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.tab:hover {
  color: var(--color-primary);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

/* --------------------------------------------------------------------------
   Chart bars (CSS-only for mock)
   -------------------------------------------------------------------------- */

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  height: 160px;
  padding-top: 0.5rem;
}

.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  height: 100%;
  justify-content: flex-end;
}

.bar-stack {
  width: 100%;
  max-width: 40px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 6px 6px 2px 2px;
  overflow: hidden;
  min-height: 4px;
}

.bar-segment {
  width: 100%;
  transition: height 400ms var(--ease);
}

.bar-label {
  font-size: 0.6875rem;
  color: var(--color-fg-muted);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */

.logo-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #0f766e);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-primary);
  flex-shrink: 0;
}

.divider {
  height: 1px;
  background: var(--color-border);
  margin: 1.25rem 0;
}

.glass-nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.scroll-fade {
  animation: fade-up 500ms var(--ease) both;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.demo-banner {
  background: linear-gradient(90deg, #0f766e, #0d9488, #14b8a6);
  color: white;
  font-size: 0.75rem;
  font-weight: 500;
  text-align: center;
  padding: 0.375rem 1rem;
}

.demo-banner a {
  color: white;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
