/* =========================================================
   WebsDocs AI Assistant Dashboard
   Premium light shell + crisp typography + no header/footer gap
   Replace: css/ai-dashboard.css
========================================================= */

:root {
  --wd-page: #fbf9ff;
  --wd-page-2: #f4f0fb;
  --wd-page-3: #f8f9fc;

  --wd-surface: #ffffff;
  --wd-surface-soft: #faf7ff;
  --wd-surface-strong: #f3ecff;
  --wd-panel: #ffffff;

  --wd-text: #160038;
  --wd-text-strong: #12002f;
  --wd-muted: #4c5872;
  --wd-soft: #667187;
  --wd-faint: #7a8498;
  --wd-white: #ffffff;

  --wd-purple: #6f1fe5;
  --wd-purple-2: #5a13c7;
  --wd-purple-dark: #2a0146;
  --wd-pink: #ff0d96;
  --wd-blue: #38bdf8;
  --wd-green: #16a34a;
  --wd-green-soft: #eafaf0;
  --wd-orange: #f59e0b;
  --wd-red: #ef4444;

  --wd-border: rgba(111, 31, 229, 0.12);
  --wd-border-strong: rgba(111, 31, 229, 0.22);
  --wd-border-white: rgba(255, 255, 255, 0.76);

  --wd-shadow-soft: 0 14px 34px rgba(42, 1, 70, 0.07);
  --wd-shadow: 0 24px 70px rgba(42, 1, 70, 0.12);
  --wd-shadow-strong: 0 34px 96px rgba(42, 1, 70, 0.16);

  --wd-radius-xl: 32px;
  --wd-radius-lg: 24px;
  --wd-radius-md: 18px;
  --wd-radius-sm: 14px;

  --wd-container: 1280px;
  --wd-header-height: 74px;
}

/* ================= RESET ================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  background: var(--wd-page);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.wd-dash-body {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  color: var(--wd-text);
  background:
    radial-gradient(circle at 11% 5%, rgba(111, 31, 229, 0.12), transparent 30%),
    radial-gradient(circle at 88% 8%, rgba(255, 13, 150, 0.08), transparent 26%),
    radial-gradient(circle at 78% 92%, rgba(56, 189, 248, 0.10), transparent 28%),
    linear-gradient(180deg, var(--wd-page) 0%, var(--wd-page-2) 48%, var(--wd-page-3) 100%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}

body.wd-dash-body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(rgba(111, 31, 229, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 31, 229, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 72%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

/* ================= GLOBAL HEADER / FOOTER ================= */

.wd-global-header,
.wd-global-footer {
  position: relative;
  z-index: 5;
  width: 100%;
  margin: 0;
  padding-inline: clamp(18px, 4vw, 44px);
  border-color: var(--wd-border);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.wd-global-header {
  min-height: var(--wd-header-height);
  padding-top: 14px;
  padding-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--wd-border);
  box-shadow: 0 10px 30px rgba(42, 1, 70, 0.045);
}

.wd-global-brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--wd-text);
}

.wd-global-brand::before {
  content: "WD";
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 15px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 950;
  letter-spacing: -0.045em;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.45), transparent 31%),
    linear-gradient(135deg, var(--wd-purple), var(--wd-pink));
  box-shadow: 0 14px 30px rgba(111, 31, 229, 0.22);
}

.wd-global-brand span,
.wd-global-brand small {
  display: block;
}

.wd-global-brand span {
  color: var(--wd-text-strong);
  font-size: 1rem;
  font-weight: 950;
  line-height: 1.1;
  letter-spacing: -0.035em;
}

.wd-global-brand small {
  margin-top: 3px;
  color: var(--wd-soft);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.15;
}

.wd-global-actions,
.wd-global-footer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.wd-global-actions a,
.wd-global-footer-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 15px;
  border: 1px solid var(--wd-border);
  border-radius: 999px;
  color: var(--wd-purple-dark);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 22px rgba(42, 1, 70, 0.045);
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease;
}

.wd-global-actions a:hover,
.wd-global-footer-actions a:hover {
  transform: translateY(-1px);
  color: var(--wd-purple-2);
  border-color: var(--wd-border-strong);
  background: #ffffff;
  box-shadow: 0 14px 28px rgba(42, 1, 70, 0.08);
}

.wd-global-actions a.is-primary {
  color: #ffffff;
  border-color: transparent;
  background: linear-gradient(135deg, var(--wd-purple), var(--wd-purple-2));
  box-shadow: 0 16px 32px rgba(90, 19, 199, 0.20);
}

.wd-global-actions a.is-admin {
  color: #8a5300;
  border-color: rgba(245, 158, 11, 0.28);
  background: #fff5db;
}

.wd-global-footer {
  margin-top: auto;
  min-height: 78px;
  padding-top: 18px;
  padding-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--wd-border);
}

.wd-global-footer strong {
  display: block;
  color: var(--wd-text-strong);
  font-size: 0.94rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.wd-global-footer span {
  display: block;
  max-width: 720px;
  margin-top: 5px;
  color: var(--wd-soft);
  font-size: 0.84rem;
  line-height: 1.45;
}

/* ================= LOGIN VIEW ================= */

.wd-login-view,
.wd-app-view {
  position: relative;
  z-index: 1;
  width: 100%;
  flex: 1 0 auto;
  min-height: 0;
}

.wd-login-view {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 52px) clamp(18px, 4vw, 44px);
  overflow: hidden;
}

.wd-login-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.wd-glow {
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  filter: blur(44px);
  opacity: 0.58;
}

.wd-glow-one {
  top: -120px;
  left: -80px;
  background: rgba(111, 31, 229, 0.22);
}

.wd-glow-two {
  right: -130px;
  bottom: 8%;
  background: rgba(255, 13, 150, 0.13);
}

.wd-grid {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(111, 31, 229, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(111, 31, 229, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(circle at 55% 42%, rgba(0, 0, 0, 0.92), transparent 76%);
  -webkit-mask-image: radial-gradient(circle at 55% 42%, rgba(0, 0, 0, 0.92), transparent 76%);
}

.wd-login-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 430px);
  gap: clamp(24px, 4vw, 44px);
  align-items: center;
}

.wd-login-brand {
  min-width: 0;
  padding: 22px 0;
  color: var(--wd-text);
}

.wd-login-logo {
  width: 76px;
  height: 76px;
  margin-bottom: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--wd-border);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: var(--wd-shadow-soft);
}

.wd-login-logo img {
  width: 52px;
}

.wd-login-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--wd-border);
  border-radius: 999px;
  color: var(--wd-purple-2);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(90, 19, 199, 0.055);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.075em;
  text-transform: uppercase;
}

.wd-login-brand h1 {
  max-width: 11ch;
  margin: 18px 0 16px;
  color: var(--wd-text-strong);
  font-size: clamp(3rem, 6vw, 5rem);
  line-height: 0.93;
  letter-spacing: -0.072em;
  text-wrap: balance;
}

.wd-login-brand p {
  max-width: 640px;
  margin: 0;
  color: var(--wd-muted);
  font-size: clamp(1.02rem, 1.5vw, 1.18rem);
  line-height: 1.75;
}

.wd-login-card {
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid rgba(111, 31, 229, 0.14);
  border-radius: var(--wd-radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88)),
    var(--wd-surface);
  box-shadow: var(--wd-shadow-strong);
}

.wd-login-card-head p,
.wd-kicker {
  margin: 0 0 9px;
  color: var(--wd-purple);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.wd-login-card-head h2 {
  margin: 0;
  color: var(--wd-text-strong);
  font-size: clamp(1.55rem, 2vw, 1.9rem);
  line-height: 1.06;
  letter-spacing: -0.045em;
}

.wd-login-card-head span {
  display: block;
  margin-top: 10px;
  color: var(--wd-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.wd-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.wd-field span {
  color: var(--wd-text-strong);
  font-size: 0.88rem;
  font-weight: 850;
}

.wd-field input {
  width: 100%;
  min-height: 52px;
  padding: 0 15px;
  border: 1px solid rgba(111, 31, 229, 0.14);
  outline: none;
  border-radius: 16px;
  color: var(--wd-text);
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.wd-field input::placeholder {
  color: #a2a7b7;
}

.wd-field input:focus {
  border-color: rgba(111, 31, 229, 0.72);
  box-shadow: 0 0 0 4px rgba(111, 31, 229, 0.10);
}

.wd-login-help {
  margin: 14px 0 0;
  color: var(--wd-soft);
  font-size: 0.88rem;
  line-height: 1.58;
}

.wd-login-links {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--wd-border);
}

.wd-login-links a {
  color: var(--wd-purple-2);
  font-size: 0.9rem;
  font-weight: 850;
}

.wd-login-links a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ================= BUTTONS ================= */

.wd-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    filter 180ms ease;
}

.wd-btn:hover {
  transform: translateY(-1px);
}

.wd-btn:active {
  transform: translateY(0);
}

.wd-btn-primary {
  width: 100%;
  margin-top: 22px;
  color: #ffffff;
  background:
    radial-gradient(circle at 20% 5%, rgba(255, 255, 255, 0.32), transparent 28%),
    linear-gradient(135deg, var(--wd-purple), var(--wd-purple-2));
  box-shadow: 0 18px 38px rgba(90, 19, 199, 0.22);
}

.wd-btn-primary:hover {
  filter: brightness(1.04);
}

.wd-btn-soft {
  color: var(--wd-purple-2);
  border-color: rgba(111, 31, 229, 0.13);
  background: #f1eaff;
}

.wd-btn-ghost {
  color: var(--wd-muted);
  border-color: rgba(111, 31, 229, 0.14);
  background: rgba(255, 255, 255, 0.62);
}

.wd-btn-soft:hover,
.wd-btn-ghost:hover {
  color: var(--wd-purple-2);
  border-color: rgba(111, 31, 229, 0.26);
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(42, 1, 70, 0.07);
}

.wd-inline-btn {
  width: auto;
  margin-top: 12px;
  padding-inline: 20px;
}

/* ================= STATUS ================= */

.wd-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--wd-soft);
  font-size: 0.88rem;
  font-weight: 760;
  line-height: 1.5;
}

.wd-status:empty {
  display: none;
}

.wd-status.is-error {
  color: var(--wd-red);
}

.wd-status.is-success {
  color: var(--wd-green);
}

/* ================= APP VIEW ================= */

.wd-app-view {
  padding: clamp(18px, 3vw, 30px) clamp(18px, 4vw, 44px);
}

.wd-app-shell {
  width: min(var(--wd-container), 100%);
  min-height: clamp(720px, calc(100vh - 190px), 980px);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius-xl);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--wd-shadow-strong);
}

/* ================= SIDEBAR ================= */

.wd-sidebar {
  min-width: 0;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  color: #ffffff;
  background:
    radial-gradient(circle at 24% 0%, rgba(255, 13, 150, 0.20), transparent 34%),
    radial-gradient(circle at 90% 16%, rgba(111, 31, 229, 0.35), transparent 28%),
    linear-gradient(180deg, #2a0146 0%, #22003b 100%);
}

.wd-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.wd-sidebar-brand a {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.wd-sidebar-brand img {
  width: 34px;
}

.wd-sidebar-brand strong {
  display: block;
  color: #ffffff;
  font-size: 1.05rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.wd-sidebar-brand span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.8rem;
  font-weight: 750;
}

.wd-nav {
  display: grid;
  gap: 8px;
}

.wd-nav button {
  min-height: 44px;
  width: 100%;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  text-align: left;
  font-weight: 850;
  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.wd-nav button:hover,
.wd-nav button.is-active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.12);
}

.wd-nav button:hover {
  transform: translateX(2px);
}

.wd-upgrade-card {
  margin-top: auto;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 255, 255, 0.12), transparent 32%),
    rgba(255, 255, 255, 0.095);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.wd-upgrade-card span {
  display: inline-block;
  margin-bottom: 10px;
  color: #e8dfff;
  font-size: 0.73rem;
  font-weight: 950;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.wd-upgrade-card strong {
  display: block;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.wd-upgrade-card p {
  margin: 10px 0 14px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.84rem;
  line-height: 1.58;
}

.wd-upgrade-card a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  color: var(--wd-purple-dark);
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.10);
}

/* ================= MAIN DASHBOARD ================= */

.wd-main {
  min-width: 0;
  padding: clamp(20px, 2.6vw, 30px);
  overflow: auto;
  background:
    radial-gradient(circle at 92% 0%, rgba(111, 31, 229, 0.06), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #faf8ff 100%);
}

.wd-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 20px;
}

.wd-topbar > div:first-child {
  min-width: 0;
}

.wd-topbar h1 {
  margin: 0;
  color: var(--wd-text-strong);
  font-size: clamp(2rem, 3.4vw, 3.15rem);
  line-height: 0.98;
  letter-spacing: -0.062em;
}

.wd-topbar span:not(.wd-plan-badge) {
  display: block;
  max-width: 760px;
  margin-top: 9px;
  color: var(--wd-muted);
  font-size: 0.98rem;
  line-height: 1.62;
}

.wd-topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.wd-plan-badge {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(22, 163, 74, 0.18);
  border-radius: 999px;
  color: #137333;
  background: var(--wd-green-soft);
  font-size: 0.8rem;
  font-weight: 950;
  line-height: 1;
}

.wd-app-status {
  margin: -6px 0 16px;
}

.wd-section {
  display: none;
}

.wd-section.is-active {
  display: block;
}

.wd-section-head {
  margin: 0 0 16px;
}

.wd-section-head h2 {
  margin: 0;
  color: var(--wd-text-strong);
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.wd-section-head p {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--wd-muted);
  font-size: 0.96rem;
  line-height: 1.68;
}

/* ================= CARDS / PANELS ================= */

.wd-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.wd-stat-card,
.wd-info-card,
.wd-panel {
  border: 1px solid var(--wd-border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.92));
  box-shadow: var(--wd-shadow-soft);
}

.wd-stat-card,
.wd-info-card {
  padding: 18px;
  border-radius: var(--wd-radius-lg);
}

.wd-panel {
  padding: 18px;
  border-radius: var(--wd-radius-lg);
}

.wd-stat-card span,
.wd-info-card span {
  display: block;
  color: var(--wd-soft);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.wd-stat-card strong {
  display: block;
  margin: 8px 0 7px;
  color: var(--wd-text-strong);
  font-size: clamp(2rem, 3.1vw, 2.8rem);
  line-height: 0.95;
  letter-spacing: -0.065em;
}

.wd-stat-card p {
  margin: 0;
  color: var(--wd-soft);
  font-size: 0.84rem;
  line-height: 1.48;
}

.wd-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 16px;
}

.wd-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 14px;
}

.wd-panel-head h3 {
  margin: 0;
  color: var(--wd-text-strong);
  font-size: 1.08rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
}

.wd-panel-head span,
.wd-panel-head button {
  color: var(--wd-soft);
  font-size: 0.82rem;
  font-weight: 850;
}

.wd-panel-head button {
  border: 0;
  background: transparent;
  color: var(--wd-purple-2);
}

.wd-panel-head button:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ================= LISTS ================= */

.wd-mini-list,
.wd-conversation-list,
.wd-lead-list,
.wd-topic-list,
.wd-page-list {
  display: grid;
  gap: 10px;
}

.wd-conversation-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: start;
}

.wd-conversation-list-panel,
.wd-detail-panel {
  min-height: 560px;
}

.wd-conversation-item,
.wd-lead-item,
.wd-page-item,
.wd-topic-item {
  width: 100%;
  border: 1px solid rgba(111, 31, 229, 0.10);
  border-radius: 18px;
  color: var(--wd-text);
  background: linear-gradient(180deg, #ffffff, #fbf9ff);
  box-shadow: 0 8px 20px rgba(42, 1, 70, 0.035);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.wd-conversation-item,
.wd-lead-item,
.wd-page-item {
  padding: 14px;
}

.wd-topic-item {
  padding: 13px 14px;
}

button.wd-conversation-item,
button.wd-lead-item {
  text-align: left;
}

button.wd-conversation-item:hover,
button.wd-conversation-item.is-active,
button.wd-lead-item:hover {
  transform: translateY(-1px);
  border-color: var(--wd-border-strong);
  box-shadow: 0 14px 30px rgba(90, 19, 199, 0.08);
  background: #ffffff;
}

.wd-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.wd-item-top strong {
  color: var(--wd-text-strong);
  font-size: 0.92rem;
  line-height: 1.35;
}

.wd-item-top span {
  color: var(--wd-faint);
  font-size: 0.76rem;
  font-weight: 850;
  white-space: nowrap;
}

.wd-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.wd-chip {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--wd-purple-2);
  background: #f1eaff;
  font-size: 0.72rem;
  font-weight: 950;
  line-height: 1;
}

.wd-chip.is-lead {
  color: #8a5300;
  background: #fff3d6;
}

.wd-chip.is-active {
  color: #137333;
  background: #dcfce7;
}

.wd-chip.is-muted {
  color: var(--wd-soft);
  background: #f2f0f7;
}

.wd-empty-state {
  min-height: 260px;
  padding: 26px;
  display: grid;
  place-items: center;
  text-align: center;
  border: 1px dashed rgba(111, 31, 229, 0.28);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #fbf8ff);
}

.wd-empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--wd-text-strong);
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.wd-empty-state p {
  max-width: 420px;
  margin: 0;
  color: var(--wd-muted);
  line-height: 1.6;
}

/* ================= DETAIL / MESSAGES ================= */

.wd-detail-body {
  display: grid;
  gap: 12px;
}

.wd-message-pair {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--wd-border);
}

.wd-message-pair:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.wd-message {
  padding: 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.wd-message span {
  display: block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.wd-message-user {
  color: #ffffff;
  background: linear-gradient(135deg, var(--wd-purple-2), var(--wd-purple));
  box-shadow: 0 12px 24px rgba(90, 19, 199, 0.14);
}

.wd-message-user span {
  color: rgba(255, 255, 255, 0.76);
}

.wd-message-ai {
  color: var(--wd-muted);
  border: 1px solid var(--wd-border);
  background: #ffffff;
}

.wd-message-ai span {
  color: var(--wd-purple-2);
}

.wd-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

/* ================= TOPICS + PAGES ================= */

.wd-topic-item {
  display: grid;
  grid-template-columns: minmax(100px, 140px) minmax(0, 1fr) 52px;
  align-items: center;
  gap: 12px;
}

.wd-topic-name {
  color: var(--wd-text-strong);
  font-weight: 900;
  text-transform: capitalize;
}

.wd-topic-bar {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eee7ff;
}

.wd-topic-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--wd-purple), var(--wd-pink));
}

.wd-topic-count {
  color: var(--wd-soft);
  text-align: right;
  font-weight: 950;
}

.wd-page-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.wd-page-item strong {
  color: var(--wd-text-strong);
  word-break: break-word;
}

.wd-page-item span {
  color: var(--wd-soft);
  font-weight: 950;
  white-space: nowrap;
}

/* ================= PROFILE + SETTINGS ================= */

.wd-profile-grid,
.wd-settings-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 16px;
}

.wd-info-card strong {
  display: block;
  margin-top: 9px;
  color: var(--wd-text-strong);
  font-size: 1.05rem;
  line-height: 1.3;
  letter-spacing: -0.025em;
  word-break: break-word;
}

.wd-note-panel h3 {
  margin: 0 0 8px;
  color: var(--wd-text-strong);
  letter-spacing: -0.025em;
}

.wd-note-panel p {
  margin: 0;
  color: var(--wd-muted);
  line-height: 1.68;
}

/* ================= DASHBOARD OPEN STATE ================= */

body.is-dashboard-open {
  overflow-x: hidden;
}

body.is-dashboard-open .wd-login-view {
  display: none;
}

body.is-dashboard-open .wd-app-view:not([hidden]) {
  display: block;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 1180px) {
  .wd-login-shell {
    grid-template-columns: 1fr;
  }

  .wd-login-brand {
    padding: 8px 0;
  }

  .wd-login-brand h1 {
    max-width: 100%;
  }

  .wd-app-shell {
    grid-template-columns: 1fr;
  }

  .wd-sidebar {
    position: relative;
  }

  .wd-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .wd-nav button {
    text-align: center;
  }

  .wd-nav button:hover {
    transform: translateY(-1px);
  }

  .wd-upgrade-card {
    display: none;
  }

  .wd-stats-grid,
  .wd-profile-grid,
  .wd-settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wd-dashboard-grid,
  .wd-conversation-layout {
    grid-template-columns: 1fr;
  }

  .wd-conversation-list-panel,
  .wd-detail-panel {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  .wd-global-header,
  .wd-global-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .wd-global-actions,
  .wd-global-footer-actions {
    justify-content: flex-start;
  }

  .wd-global-actions a,
  .wd-global-footer-actions a {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 0.78rem;
  }

  .wd-login-view,
  .wd-app-view {
    padding: 14px;
  }

  .wd-login-card,
  .wd-main,
  .wd-sidebar {
    padding: 16px;
  }

  .wd-login-shell {
    gap: 18px;
  }

  .wd-login-logo {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin-bottom: 20px;
  }

  .wd-login-logo img {
    width: 44px;
  }

  .wd-app-shell,
  .wd-login-card {
    border-radius: 24px;
  }

  .wd-topbar {
    display: grid;
  }

  .wd-topbar-actions {
    justify-content: flex-start;
  }

  .wd-btn {
    min-height: 44px;
  }

  .wd-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wd-stats-grid,
  .wd-profile-grid,
  .wd-settings-grid {
    grid-template-columns: 1fr;
  }

  .wd-dashboard-grid {
    gap: 12px;
  }

  .wd-topic-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wd-topic-count {
    text-align: left;
  }

  .wd-login-links {
    display: grid;
  }
}

@media (max-width: 460px) {
  .wd-global-brand::before {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .wd-login-view,
  .wd-app-view {
    padding: 10px;
  }

  .wd-sidebar,
  .wd-main,
  .wd-login-card,
  .wd-panel,
  .wd-stat-card,
  .wd-info-card {
    padding: 14px;
  }

  .wd-nav {
    grid-template-columns: 1fr;
  }

  .wd-topbar-actions,
  .wd-topbar-actions .wd-btn,
  .wd-btn-primary {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
