/* =========================================================
   WEBDOCS PAID / CRM DASHBOARD V8
   Premium SaaS Client Portal
   Dark command bar · light dashboard cards · AI-ready CRM system
========================================================= */

:root {
  /* ===============================
     CORE SURFACES
  ================================ */

  --pd-bg: #fbf9ff;
  --pd-bg-soft: #f8fbff;
  --pd-surface: #ffffff;
  --pd-surface-soft: #fbf9ff;
  --pd-surface-tint: #f7f1ff;

  /* ===============================
     TEXT
  ================================ */

  --pd-ink: #0b1020;
  --pd-text: #26324a;
  --pd-text-strong: #160038;
  --pd-muted: #667187;
  --pd-soft: #8a94a6;

  /* ===============================
     BRAND / SAAS SYSTEM
  ================================ */

  --pd-deep: #160038;
  --pd-deep-2: #240035;
  --pd-deep-3: #2a0146;

  --pd-purple: #6f1fe5;
  --pd-purple-deep: #4f0fb8;
  --pd-purple-soft: #f7f1ff;
  --pd-purple-line: rgba(111, 31, 229, 0.18);

  --pd-pink: #ff0d96;
  --pd-pink-deep: #d41486;
  --pd-pink-soft: rgba(255, 13, 150, 0.09);
  --pd-pink-line: rgba(255, 13, 150, 0.22);

  --pd-cyan: #00c0f3;
  --pd-cyan-deep: #0369a1;
  --pd-cyan-soft: #eefbff;
  --pd-cyan-line: rgba(0, 192, 243, 0.24);

  /* Keep blue only as a utility tone, not the dashboard identity */
  --pd-blue: #2563eb;
  --pd-blue-deep: #1d4ed8;
  --pd-blue-soft: #eef4ff;
  --pd-blue-line: rgba(37, 99, 235, 0.22);

  --pd-green: #137347;
  --pd-green-soft: rgba(19, 155, 98, 0.10);
  --pd-green-line: rgba(19, 155, 98, 0.24);

  --pd-gold: #92400e;
  --pd-gold-soft: #fffaf0;
  --pd-gold-line: rgba(244, 199, 107, 0.42);

  --pd-red: #b42318;
  --pd-red-soft: #fff1f0;
  --pd-red-line: rgba(180, 35, 24, 0.22);

  --pd-stone: #57534e;
  --pd-stone-soft: #f5f3ef;
  --pd-stone-line: #ddd6c8;

  /* Backward-compatible aliases for old selectors */
  --pd-navy: var(--pd-deep);
  --pd-navy-2: var(--pd-deep-2);
  --pd-navy-3: var(--pd-deep-3);

  /* ===============================
     LINES / SHADOWS
  ================================ */

  --pd-line: rgba(111, 31, 229, 0.11);
  --pd-line-strong: rgba(111, 31, 229, 0.18);

  --pd-shadow-xs: 0 6px 18px rgba(42, 1, 70, 0.045);
  --pd-shadow-sm: 0 10px 26px rgba(42, 1, 70, 0.065);
  --pd-shadow-md: 0 18px 48px rgba(42, 1, 70, 0.085);
  --pd-shadow-lg: 0 30px 82px rgba(42, 1, 70, 0.16);

  --pd-shadow-dark:
    0 28px 76px rgba(11, 16, 32, 0.30),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);

  /* ===============================
     RADIUS / WIDTH
  ================================ */

  --pd-radius-xl: 30px;
  --pd-radius-lg: 24px;
  --pd-radius-md: 18px;
  --pd-radius-sm: 14px;

  --pd-shell: 1860px;
  --pd-header-h: 84px;
}

/* =========================================================
   BASE
========================================================= */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  width: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  width: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;

  color: var(--pd-text);
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;

  background:
    radial-gradient(circle at 8% 7%, rgba(111, 31, 229, 0.11), transparent 28%),
    radial-gradient(circle at 92% 12%, rgba(255, 13, 150, 0.06), transparent 25%),
    radial-gradient(circle at 82% 92%, rgba(0, 192, 243, 0.06), transparent 24%),
    linear-gradient(180deg, #fbf9ff 0%, #f8fbff 54%, #fbf9ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

img {
  display: block;
  max-width: 100%;
}

.wd-hidden {
  display: none !important;
}

.pd-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.pd-shell {
  width: min(var(--pd-shell), calc(100% - 34px));
  margin: 0 auto;
}

.pd-main {
  flex: 1;
  padding: 28px 0 34px;
}

/* =========================================================
   AUTH VISIBILITY
========================================================= */

body.pd-auth-locked .aih-header,
body.pd-auth-locked .ai-footer,
body.pd-auth-locked #dashboardSection {
  display: none !important;
}

body.pd-auth-locked #loginSection {
  display: block !important;
}

body.pd-auth-locked .pd-main {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: 34px 0;
}

body.pd-auth-locked .pd-shell {
  width: min(100% - 28px, 1040px);
}

body.pd-authenticated .aih-header,
body.pd-authenticated .ai-footer {
  display: block;
}

body.pd-authenticated #loginSection {
  display: none !important;
}

body.pd-authenticated #dashboardSection {
  display: grid !important;
}

body.pd-authenticated .pd-main {
  min-height: auto;
  display: block;
  padding: 28px 0 34px;
}

body.pd-authenticated .pd-shell {
  width: min(var(--pd-shell), calc(100% - 34px));
}

body.pd-auth-locked .pd-login-wrap {
  padding: 0;
}

/* =========================================================
   BUTTONS
========================================================= */

.pd-btn,
.ai-product-logout {
  appearance: none;
  cursor: pointer;
  border-radius: 999px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  text-decoration: none;
  white-space: nowrap;

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.pd-btn {
  min-height: 48px;
  padding: 0 18px;
  font-size: 0.94rem;
  font-weight: 850;
}

.pd-btn:hover,
.pd-btn:focus-visible,
.ai-product-logout:hover,
.ai-product-logout:focus-visible {
  transform: translateY(-1px);
  outline: none;
}

.pd-btn-primary {
  color: #ffffff;
  background:
    linear-gradient(135deg, var(--pd-purple) 0%, var(--pd-pink) 100%);
  border: 1px solid rgba(111, 31, 229, 0.18);
  box-shadow:
    0 18px 34px rgba(255, 13, 150, 0.20),
    0 10px 20px rgba(90, 19, 199, 0.16);
}

.pd-btn-primary:hover,
.pd-btn-primary:focus-visible {
  background:
    linear-gradient(135deg, var(--pd-purple-deep) 0%, var(--pd-pink-deep) 100%);
  box-shadow:
    0 22px 42px rgba(255, 13, 150, 0.28),
    0 14px 28px rgba(90, 19, 199, 0.22);
}

.pd-btn-soft {
  color: var(--pd-purple-deep);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--pd-line);
  box-shadow: var(--pd-shadow-sm);
}

.pd-btn-soft:hover,
.pd-btn-soft:focus-visible {
  color: var(--pd-deep);
  background: var(--pd-purple-soft);
  border-color: var(--pd-line-strong);
  box-shadow: var(--pd-shadow-md);
}

.ai-product-logout {
  min-height: 40px;
  padding: 0 14px;

  border: 1px solid rgba(180, 35, 24, 0.26);
  color: #ffffff;
  background: rgba(180, 35, 24, 0.90);

  font-size: 0.82rem;
  font-weight: 850;
}

.ai-product-logout:hover,
.ai-product-logout:focus-visible {
  background: var(--pd-red);
}

#logoutBtn.wd-hidden {
  display: none !important;
}

/* =========================================================
   KICKER / STATUS
========================================================= */

.pd-kicker {
  display: inline-flex;
  align-items: center;

  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;

  background: var(--pd-purple-soft);
  border: 1px solid var(--pd-purple-line);

  color: var(--pd-purple);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pd-status {
  min-height: 24px;
  margin-top: 14px;
  font-size: 0.92rem;
  font-weight: 750;
}

.pd-status-inline {
  margin-top: 0;
  margin-bottom: 14px;
}

.pd-status.is-success {
  color: var(--pd-green);
}

.pd-status.is-error {
  color: var(--pd-red);
}

.pd-status.is-warning {
  color: var(--pd-gold);
}

.pd-status.is-loading {
  color: var(--pd-purple);
}

/* =========================================================
   LOGIN
========================================================= */

.pd-login-wrap {
  padding-top: 8px;
}

.pd-login-card {
  position: relative;
  overflow: hidden;

  max-width: 980px;
  margin: 0 auto;
  padding: 36px;
  border-radius: var(--pd-radius-xl);

  border: 1px solid rgba(111, 31, 229, 0.15);
  background:
    radial-gradient(circle at 0% 0%, rgba(111, 31, 229, 0.08), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(255, 13, 150, 0.07), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 249, 255, 0.95) 100%);

  box-shadow: var(--pd-shadow-lg);
}

.pd-login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background:
    linear-gradient(90deg, var(--pd-purple) 0%, var(--pd-pink) 52%, var(--pd-cyan) 100%);
}

.pd-login-head h1 {
  margin: 16px 0 10px;

  color: var(--pd-text-strong);
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.pd-login-head p {
  margin: 0;
  max-width: 64ch;

  color: var(--pd-muted);
  font-size: 1rem;
  line-height: 1.7;
}

.pd-form {
  margin-top: 26px;
}

.pd-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.pd-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-field span {
  color: var(--pd-text-strong);
  font-size: 0.92rem;
  font-weight: 850;
}

.pd-field input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;

  border-radius: 18px;
  border: 1px solid var(--pd-line);
  background: rgba(255, 255, 255, 0.96);

  color: var(--pd-text);
  outline: none;

  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.pd-field input:focus {
  border-color: rgba(111, 31, 229, 0.34);
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(111, 31, 229, 0.10);
}

.pd-form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.pd-login-note {
  margin-top: 24px;
  padding: 18px 20px;

  border-radius: 18px;
  border: 1px solid var(--pd-line);
  background:
    radial-gradient(circle at 0% 0%, rgba(111, 31, 229, 0.06), transparent 34%),
    linear-gradient(135deg, #ffffff, #fbf9ff);
}

.pd-login-note strong {
  display: block;
  margin-bottom: 6px;

  color: var(--pd-text-strong);
  font-size: 0.96rem;
}

.pd-login-note p {
  margin: 0;
  color: var(--pd-muted);
  line-height: 1.7;
}

/* =========================================================
   DASHBOARD TOP
========================================================= */

.pd-dashboard {
  display: grid;
  gap: 18px;
}

.pd-utility-bar {
  position: relative;
  overflow: hidden;

  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;

  padding: 26px 28px;
  border-radius: var(--pd-radius-lg);

  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 12% 0%, rgba(111, 31, 229, 0.34), transparent 36%),
    radial-gradient(circle at 92% 6%, rgba(255, 13, 150, 0.18), transparent 30%),
    linear-gradient(135deg, var(--pd-deep) 0%, var(--pd-deep-2) 58%, var(--pd-ink) 100%);

  color: #ffffff;
  box-shadow: var(--pd-shadow-dark);
}

.pd-utility-bar::after {
  content: "";
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(0, 192, 243, 0.14), transparent 68%);
  pointer-events: none;
}

.pd-utility-copy,
.pd-utility-actions {
  position: relative;
  z-index: 1;
}

.pd-utility-copy h2 {
  margin: 12px 0 8px;

  color: #ffffff;
  font-size: clamp(1.65rem, 2.4vw, 2.35rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 900;
}

.pd-utility-copy p {
  margin: 0;
  max-width: 64ch;

  color: rgba(255, 255, 255, 0.76);
  line-height: 1.7;
}

.pd-utility-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pd-utility-bar .pd-kicker {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.86);
}

/* =========================================================
   STATS
========================================================= */

.pd-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.pd-stat-card {
  position: relative;
  overflow: hidden;

  padding: 22px;
  border-radius: 22px;

  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.06), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid var(--pd-line);
  box-shadow: var(--pd-shadow-md);
}

.pd-stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: rgba(111, 31, 229, 0.16);
}

.pd-stat-card-identity::before {
  background: linear-gradient(90deg, var(--pd-purple), var(--pd-pink));
}

.pd-stat-card-plan::before {
  background: var(--pd-green);
}

.pd-stat-card-activity::before {
  background: var(--pd-gold);
}

.pd-stat-card-events::before {
  background: linear-gradient(90deg, var(--pd-purple), var(--pd-cyan));
}

.pd-stat-label {
  display: block;
  margin-bottom: 10px;

  color: var(--pd-muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pd-stat-card strong {
  display: block;

  color: var(--pd-text-strong);
  font-size: 1.52rem;
  line-height: 1.04;
  letter-spacing: -0.04em;
  word-break: break-word;
}

.pd-stat-card small {
  display: block;
  margin-top: 10px;

  color: var(--pd-muted);
  line-height: 1.5;
}

/* =========================================================
   APP SHELL / SIDEBAR
========================================================= */

.pd-app-shell {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.pd-sidebar {
  display: grid;
  gap: 18px;
  align-self: start;

  position: sticky;
  top: 96px;
}

.pd-sidebar-card {
  padding: 20px;
  border-radius: var(--pd-radius-lg);

  border: 1px solid var(--pd-line);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.06), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  box-shadow: var(--pd-shadow-md);
}

.pd-sidebar-label {
  margin: 0 0 14px;

  color: var(--pd-muted);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pd-nav-link {
  width: 100%;
  min-height: 48px;
  margin-bottom: 10px;
  padding: 0 14px;

  display: flex;
  align-items: center;
  gap: 12px;

  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);

  color: var(--pd-deep);
  cursor: pointer;
  text-align: left;

  font-size: 0.92rem;
  font-weight: 850;

  transition:
    background 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    color 180ms ease;
}

.pd-nav-link:hover,
.pd-nav-link:focus-visible {
  transform: translateY(-1px);
  outline: none;

  background: var(--pd-purple-soft);
  border-color: var(--pd-purple-line);
  box-shadow: var(--pd-shadow-xs);
}

.pd-nav-link span {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;

  display: grid;
  place-items: center;

  border-radius: 12px;
  background: rgba(111, 31, 229, 0.08);
  color: var(--pd-purple);

  font-size: 0.76rem;
  font-weight: 900;
}

.pd-nav-link.is-active {
  color: var(--pd-deep);
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 13, 150, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--pd-purple-soft) 100%);

  border-color: var(--pd-purple-line);
  box-shadow: 0 12px 28px rgba(90, 19, 199, 0.10);
}

.pd-nav-link.is-active span {
  background:
    linear-gradient(135deg, var(--pd-purple) 0%, var(--pd-pink) 100%);
  color: #ffffff;
}

.pd-action-stack {
  display: grid;
  gap: 12px;
}

/* =========================================================
   CONTENT / VIEWS
========================================================= */

.pd-content {
  display: grid;
  min-width: 0;
}

.pd-view {
  display: none;
  gap: 18px;
  min-width: 0;
}

.pd-view.is-active {
  display: grid;
}

.pd-view-head {
  position: relative;
  overflow: hidden;

  padding: 24px 26px;
  border-radius: var(--pd-radius-lg);

  border: 1px solid var(--pd-line);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.07), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  box-shadow: var(--pd-shadow-md);
}

.pd-view-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 22px;
  bottom: 22px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--pd-purple) 0%, var(--pd-pink) 100%);
}

.pd-view-head h3 {
  margin: 12px 0 8px;

  color: var(--pd-text-strong);
  font-size: 1.5rem;
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.pd-view-head p {
  margin: 0;
  color: var(--pd-muted);
  line-height: 1.7;
}

/* =========================================================
   CARDS
========================================================= */

.pd-card-grid {
  display: grid;
  gap: 16px;
}

.pd-card-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pd-card-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pd-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 24px;

  border-radius: var(--pd-radius-lg);
  border: 1px solid var(--pd-line);

  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.055), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  box-shadow: var(--pd-shadow-md);
}

.pd-card-head h4 {
  margin: 10px 0 8px;

  color: var(--pd-text-strong);
  font-size: 1.18rem;
  line-height: 1.08;
  letter-spacing: -0.035em;
  font-weight: 900;
}

.pd-card-head p {
  margin: 0;
  color: var(--pd-muted);
  line-height: 1.65;
}

.pd-guide-card strong {
  display: block;
  margin-bottom: 8px;

  color: var(--pd-text-strong);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
  font-weight: 900;
}

.pd-guide-card p {
  margin: 0;
  color: var(--pd-muted);
  line-height: 1.72;
}

/* =========================================================
   DETAILS / MINI ITEMS
========================================================= */

.pd-detail-grid,
.pd-mini-grid {
  margin-top: 18px;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pd-detail-item,
.pd-mini-item {
  min-width: 0;
  padding: 18px;

  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.045), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 18px rgba(42, 1, 70, 0.045);
}

.pd-detail-item span,
.pd-mini-item span {
  display: block;
  margin-bottom: 8px;

  color: var(--pd-muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pd-detail-item strong,
.pd-mini-item strong {
  display: block;

  color: var(--pd-text-strong);
  font-size: 0.98rem;
  line-height: 1.55;
  word-break: break-word;
}

.pd-tone-success {
  background:
    radial-gradient(circle at 100% 0%, rgba(19, 155, 98, 0.10), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, rgba(19, 155, 98, 0.07) 100%);
  border-color: var(--pd-green-line);
}

.pd-tone-success strong {
  color: var(--pd-green);
}

.pd-tone-info {
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.09), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--pd-purple-soft) 100%);
  border-color: var(--pd-purple-line);
}

.pd-tone-info strong {
  color: var(--pd-purple);
}

.pd-tone-gold {
  background:
    radial-gradient(circle at 100% 0%, rgba(244, 199, 107, 0.18), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--pd-gold-soft) 100%);
  border-color: var(--pd-gold-line);
}

.pd-tone-gold strong {
  color: var(--pd-gold);
}

.pd-tone-neutral {
  background:
    linear-gradient(180deg, #ffffff 0%, var(--pd-stone-soft) 100%);
  border-color: var(--pd-stone-line);
}

.pd-tone-neutral strong {
  color: var(--pd-stone);
}

/* =========================================================
   AI CREDITS
========================================================= */

.pd-credit-balance-card,
.pd-credit-control-card,
.pd-credit-topup-card,
.pd-credit-history-card,
.pd-credit-rules-card,
.pd-credit-guidance-card {
  position: relative;
  overflow: hidden;
}

.pd-credit-balance-card::before,
.pd-credit-control-card::before,
.pd-credit-topup-card::before,
.pd-credit-history-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background:
    linear-gradient(90deg, var(--pd-gold) 0%, #f4c76b 100%);
}

.pd-credit-rules-card::before,
.pd-credit-guidance-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background:
    linear-gradient(90deg, var(--pd-purple) 0%, var(--pd-pink) 100%);
}

.pd-credit-detail-grid .pd-detail-item {
  background:
    radial-gradient(circle at 0% 0%, rgba(244, 199, 107, 0.16), transparent 35%),
    linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);
  border-color: var(--pd-gold-line);
}

.pd-credit-status-note {
  margin-top: 16px;
  padding: 16px;

  border-radius: 16px;
  border: 1px solid var(--pd-gold-line);
  background:
    radial-gradient(circle at 100% 0%, rgba(244, 199, 107, 0.20), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--pd-gold-soft) 100%);

  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 18px rgba(146, 64, 14, 0.055);
}

.pd-credit-status-note p {
  margin: 0;
  color: var(--pd-gold);
  font-size: 0.9rem;
  line-height: 1.65;
  font-weight: 700;
}

.pd-credit-rule-grid {
  margin-top: 18px;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pd-credit-rule-item {
  padding: 16px;

  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.06), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.11);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 18px rgba(42, 1, 70, 0.04);
}

.pd-credit-rule-item span {
  display: block;
  margin-bottom: 8px;

  color: var(--pd-muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pd-credit-rule-item strong {
  color: var(--pd-text-strong);
  font-size: 0.94rem;
  line-height: 1.4;
}

.pd-credit-pack-grid {
  margin-top: 18px;

  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.pd-credit-pack {
  position: relative;
  overflow: hidden;

  min-height: 138px;
  padding: 18px;

  cursor: pointer;
  text-align: left;

  border-radius: 20px;
  border: 1px solid rgba(111, 31, 229, 0.12);

  background:
    radial-gradient(circle at 100% 0%, rgba(244, 199, 107, 0.15), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fffaf0 100%);

  box-shadow: var(--pd-shadow-xs);

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.pd-credit-pack::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background:
    linear-gradient(90deg, var(--pd-gold) 0%, #f4c76b 100%);
  opacity: 0.85;
}

.pd-credit-pack:hover,
.pd-credit-pack:focus-visible {
  transform: translateY(-2px);
  outline: none;

  border-color: var(--pd-gold-line);
  box-shadow:
    0 20px 44px rgba(146, 64, 14, 0.12),
    0 8px 18px rgba(42, 1, 70, 0.06);
}

.pd-credit-pack span {
  display: inline-flex;
  align-items: center;

  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;

  background: rgba(244, 199, 107, 0.18);
  border: 1px solid rgba(244, 199, 107, 0.38);

  color: var(--pd-gold);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pd-credit-pack strong {
  display: block;
  margin: 14px 0 8px;

  color: var(--pd-text-strong);
  font-size: 1.65rem;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.pd-credit-pack small {
  display: block;

  color: var(--pd-muted);
  line-height: 1.55;
  font-weight: 650;
}

.pd-credit-ledger-list {
  margin-top: 18px;
}

/* =========================================================
   BILLING / LEDGER ROWS
========================================================= */

#billingUsageList,
#billingAlertList,
#aiCreditLedgerList {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.pd-billing-row {
  padding: 14px 16px;

  border-radius: 16px;
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.045), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 18px rgba(42, 1, 70, 0.04);
}

.pd-billing-row strong {
  display: block;
  margin-bottom: 5px;

  color: var(--pd-text-strong);
  font-size: 0.92rem;
  font-weight: 900;
}

.pd-billing-row span {
  display: block;

  color: var(--pd-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

/* =========================================================
   CONVERSATIONS
========================================================= */

.pd-conversation-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.94fr);
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.pd-conversation-layout > .pd-card {
  min-height: 0;
}

.pd-conversation-list {
  display: grid;
  gap: 12px;
}

.wd-conversation-item {
  width: 100%;
  padding: 18px;

  text-align: left;
  cursor: pointer;

  border-radius: 20px;
  border: 1px solid rgba(111, 31, 229, 0.11);

  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.045), transparent 34%),
    rgba(255, 255, 255, 0.96);

  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 18px rgba(42, 1, 70, 0.04);

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.wd-conversation-item:hover,
.wd-conversation-item:focus-visible {
  transform: translateY(-1px);
  border-color: var(--pd-purple-line);
  box-shadow: var(--pd-shadow-sm);
  outline: none;
}

.wd-conversation-item.is-active {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 13, 150, 0.08), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, var(--pd-purple-soft) 100%);

  border-color: var(--pd-purple-line);
  box-shadow: 0 16px 34px rgba(90, 19, 199, 0.10);
}

.wd-conversation-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.wd-conversation-title {
  color: var(--pd-text-strong);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.wd-conversation-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.wd-badge {
  display: inline-flex;
  align-items: center;

  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;

  background: var(--pd-purple-soft);
  border: 1px solid var(--pd-purple-line);

  color: var(--pd-purple);
  font-size: 0.76rem;
  font-weight: 850;
}

.wd-badge-accent {
  background: rgba(244, 199, 107, 0.18);
  border-color: var(--pd-gold-line);
  color: var(--pd-gold);
}

.wd-conversation-snippet {
  margin-top: 12px;

  color: var(--pd-muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.pd-conversation-layout > .pd-card:nth-child(2) {
  position: sticky;
  top: 96px;

  max-height: calc(100vh - 120px);

  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pd-conversation-layout > .pd-card:nth-child(2) .pd-card-head {
  flex: 0 0 auto;
}

.pd-viewer {
  flex: 1 1 auto;
  min-height: 0;

  display: grid;
  gap: 12px;

  overflow-y: auto;
  padding-right: 6px;

  scrollbar-width: thin;
  scrollbar-color: rgba(111, 31, 229, 0.34) rgba(111, 31, 229, 0.06);
}

.pd-viewer::-webkit-scrollbar {
  width: 8px;
}

.pd-viewer::-webkit-scrollbar-track {
  background: rgba(111, 31, 229, 0.06);
  border-radius: 999px;
}

.pd-viewer::-webkit-scrollbar-thumb {
  background: rgba(111, 31, 229, 0.30);
  border-radius: 999px;
}

.pd-viewer::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 31, 229, 0.44);
}

.wd-conversation-block {
  padding: 18px;

  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.045), transparent 34%),
    #ffffff;

  border: 1px solid rgba(111, 31, 229, 0.11);
  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 18px rgba(42, 1, 70, 0.035);
}

.wd-conversation-block h3 {
  margin: 0 0 10px;

  color: var(--pd-text-strong);
  font-size: 1rem;
  letter-spacing: -0.02em;
  font-weight: 900;
}

.wd-conversation-block p {
  margin: 0 0 8px;
  color: var(--pd-muted);
  line-height: 1.6;
}

.wd-message-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.wd-message {
  padding: 14px 16px;

  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
}

.wd-message-role {
  display: block;
  margin-bottom: 8px;

  color: var(--pd-purple);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wd-message-text {
  color: var(--pd-text);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* =========================================================
   INSIGHTS / PLACEHOLDERS / NOTES
========================================================= */

.pd-insight-grid,
.pd-placeholder-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.pd-note-block {
  margin-top: 18px;
  padding: 18px;

  border-radius: 18px;
  background:
    radial-gradient(circle at 0% 0%, rgba(111, 31, 229, 0.065), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.11);

  box-shadow:
    inset 0 1px 0 #ffffff,
    0 8px 18px rgba(42, 1, 70, 0.04);
}

.pd-note-block p {
  margin: 0;
  color: var(--pd-muted);
  line-height: 1.75;
}

.pd-empty {
  padding: 22px;
  border-radius: 18px;

  border: 1px dashed rgba(111, 31, 229, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.055), transparent 34%),
    rgba(255, 255, 255, 0.82);
}

.pd-empty strong {
  display: block;
  margin-bottom: 6px;

  color: var(--pd-text-strong);
  font-size: 0.96rem;
  font-weight: 900;
}

.pd-empty p {
  margin: 0;
  color: var(--pd-muted);
  line-height: 1.65;
}

/* =========================================================
   FEATURE ACCESS
========================================================= */

.pd-access-scale {
  display: grid;
  gap: 10px;
}

.pd-access-scale > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;

  padding: 14px 16px;
  border-radius: 16px;

  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.05), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
}

.pd-access-scale span {
  color: var(--pd-muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.pd-access-scale strong {
  color: var(--pd-text-strong);
  font-size: 0.9rem;
  font-weight: 900;
}

.pd-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.pd-feature-pill {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;

  min-height: 76px;
  padding: 15px;

  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
}

.pd-feature-pill strong {
  display: block;

  color: var(--pd-text-strong);
  font-size: 0.88rem;
  line-height: 1.35;
  font-weight: 900;
}

.pd-feature-pill span {
  display: inline-flex;
  align-items: center;

  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;

  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}

.pd-feature-pill.is-unlocked {
  background:
    radial-gradient(circle at 100% 0%, rgba(19, 155, 98, 0.12), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, rgba(19, 155, 98, 0.07) 100%);
  border-color: var(--pd-green-line);
}

.pd-feature-pill.is-unlocked span {
  background: var(--pd-green);
  color: #ffffff;
}

.pd-feature-pill.is-locked {
  background:
    linear-gradient(180deg, #ffffff 0%, var(--pd-stone-soft) 100%);
  border-color: var(--pd-stone-line);
}

.pd-feature-pill.is-locked strong {
  color: #78716c;
}

.pd-feature-pill.is-locked span {
  background: #78716c;
  color: #ffffff;
}

.pd-feature-locked {
  position: relative;
  opacity: 0.74;
}

.pd-feature-locked::after {
  content: "Plan locked";
  position: absolute;
  top: 18px;
  right: 18px;

  min-height: 28px;
  display: inline-flex;
  align-items: center;

  padding: 0 10px;
  border-radius: 999px;

  background: #57534e;
  color: #ffffff;

  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.pd-locked-note {
  margin-top: 18px;
  padding: 16px;

  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, var(--pd-stone-soft) 100%);
  border: 1px solid var(--pd-stone-line);
}

.pd-locked-note strong {
  display: block;
  margin-bottom: 6px;

  color: var(--pd-stone);
  font-size: 0.92rem;
  font-weight: 900;
}

.pd-locked-note p {
  margin: 0 0 12px;
  color: #78716c;
  font-size: 0.88rem;
  line-height: 1.6;
}

.pd-feature-locked .pd-placeholder-list,
.pd-feature-locked .pd-insight-grid,
.pd-feature-locked .pd-detail-grid,
.pd-feature-locked .pd-note-block {
  filter: grayscale(0.25);
}

/* =========================================================
   CLIENT GUIDANCE / FOOTER SUPPORT
========================================================= */

.pd-dashboard-guidance {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.pd-dashboard-guidance-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;

  padding: 22px;
  border-radius: var(--pd-radius-lg);

  border: 1px solid var(--pd-line);
  background:
    radial-gradient(circle at 0% 0%, rgba(111, 31, 229, 0.07), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(255, 13, 150, 0.05), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  box-shadow: var(--pd-shadow-md);
}

.pd-footer {
  padding: 0 0 24px;
}

.pd-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;

  min-height: 74px;
  padding: 18px 22px;

  border-radius: 22px;
  border: 1px solid var(--pd-line);

  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.055), transparent 34%),
    rgba(255, 255, 255, 0.88);

  box-shadow: var(--pd-shadow-sm);
}

.pd-footer-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pd-footer-copy strong {
  color: var(--pd-text-strong);
  font-size: 0.96rem;
  font-weight: 900;
}

.pd-footer-copy span {
  color: var(--pd-muted);
  font-size: 0.88rem;
}

.pd-footer-links {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.pd-footer-links a {
  color: var(--pd-purple);
  font-size: 0.88rem;
  font-weight: 850;
}

.pd-footer-links a:hover,
.pd-footer-links a:focus-visible {
  color: var(--pd-pink-deep);
  outline: none;
}

/* =========================================================
   USAGE CHART / BILLING TOGGLES
========================================================= */

.pd-usage-chart-shell {
  display: grid;
  gap: 16px;
}

.pd-usage-chart-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.pd-usage-chart-toolbar strong {
  display: block;
  color: var(--pd-text-strong);
  font-size: 0.98rem;
  font-weight: 900;
}

.pd-usage-chart-toolbar p,
.pd-usage-chart-note {
  margin: 6px 0 0;
  color: var(--pd-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.pd-usage-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pd-usage-toggle {
  border: 1px solid var(--pd-purple-line);
  background: #ffffff;
  color: var(--pd-purple);

  border-radius: 999px;
  padding: 8px 12px;

  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;

  cursor: pointer;

  transition:
    background 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.pd-usage-toggle:hover,
.pd-usage-toggle:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(111, 31, 229, 0.32);
  box-shadow: 0 0 0 4px rgba(111, 31, 229, 0.08);
}

.pd-usage-toggle.is-active {
  background:
    linear-gradient(135deg, var(--pd-purple) 0%, var(--pd-pink) 100%);
  border-color: transparent;
  color: #ffffff;
}

.pd-usage-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pd-usage-metrics span {
  border: 1px solid rgba(111, 31, 229, 0.12);
  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border-radius: 16px;
  padding: 10px 12px;

  color: var(--pd-muted);
  font-size: 0.84rem;
}

.pd-usage-metrics strong {
  color: var(--pd-text-strong);
}

.pd-usage-chart {
  min-height: 168px;
  max-height: 220px;

  display: flex;
  align-items: flex-end;
  gap: 8px;

  padding: 18px 12px 8px;

  border: 1px dashed rgba(111, 31, 229, 0.24);
  border-radius: 18px;

  background:
    radial-gradient(circle at 100% 0%, rgba(0, 192, 243, 0.055), transparent 34%),
    rgba(255, 255, 255, 0.72);

  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 31, 229, 0.32) rgba(111, 31, 229, 0.06);
}

.pd-usage-chart::-webkit-scrollbar {
  height: 8px;
}

.pd-usage-chart::-webkit-scrollbar-track {
  background: rgba(111, 31, 229, 0.06);
  border-radius: 999px;
}

.pd-usage-chart::-webkit-scrollbar-thumb {
  background: rgba(111, 31, 229, 0.30);
  border-radius: 999px;
}

.pd-usage-bar-item {
  min-width: 34px;
  flex: 1 0 34px;

  display: grid;
  align-items: end;
  justify-items: center;
  gap: 8px;
}

.pd-usage-bar {
  width: 100%;
  max-width: 36px;
  min-height: 4px;

  border-radius: 999px 999px 6px 6px;
  background:
    linear-gradient(180deg, var(--pd-purple) 0%, var(--pd-pink) 100%);
  box-shadow: 0 8px 16px rgba(90, 19, 199, 0.12);
}

.pd-usage-bar-item small {
  color: var(--pd-muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

/* =========================================================
   LIVE BILLING / USAGE PANELS
   Scroll limits + provider split + quota + billing history
========================================================= */

#billingUsageList,
#billingAlertList,
#aiCreditLedgerList,
#providerUsageSplitPanel,
#quotaWarningPanel,
#billingHistoryPanel {
  min-height: 0;
}

#billingUsageList,
#aiCreditLedgerList {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 31, 229, 0.34) rgba(111, 31, 229, 0.06);
}

#billingAlertList,
#providerUsageSplitPanel,
#quotaWarningPanel,
#billingHistoryPanel {
  max-height: 440px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 31, 229, 0.34) rgba(111, 31, 229, 0.06);
}

#billingUsageList::-webkit-scrollbar,
#billingAlertList::-webkit-scrollbar,
#aiCreditLedgerList::-webkit-scrollbar,
#providerUsageSplitPanel::-webkit-scrollbar,
#quotaWarningPanel::-webkit-scrollbar,
#billingHistoryPanel::-webkit-scrollbar,
.pd-scroll-list-small::-webkit-scrollbar,
.pd-support-case-list::-webkit-scrollbar {
  width: 8px;
}

#billingUsageList::-webkit-scrollbar-track,
#billingAlertList::-webkit-scrollbar-track,
#aiCreditLedgerList::-webkit-scrollbar-track,
#providerUsageSplitPanel::-webkit-scrollbar-track,
#quotaWarningPanel::-webkit-scrollbar-track,
#billingHistoryPanel::-webkit-scrollbar-track,
.pd-scroll-list-small::-webkit-scrollbar-track,
.pd-support-case-list::-webkit-scrollbar-track {
  background: rgba(111, 31, 229, 0.06);
  border-radius: 999px;
}

#billingUsageList::-webkit-scrollbar-thumb,
#billingAlertList::-webkit-scrollbar-thumb,
#aiCreditLedgerList::-webkit-scrollbar-thumb,
#providerUsageSplitPanel::-webkit-scrollbar-thumb,
#quotaWarningPanel::-webkit-scrollbar-thumb,
#billingHistoryPanel::-webkit-scrollbar-thumb,
.pd-scroll-list-small::-webkit-scrollbar-thumb,
.pd-support-case-list::-webkit-scrollbar-thumb {
  background: rgba(111, 31, 229, 0.30);
  border-radius: 999px;
}

#billingUsageList::-webkit-scrollbar-thumb:hover,
#billingAlertList::-webkit-scrollbar-thumb:hover,
#aiCreditLedgerList::-webkit-scrollbar-thumb:hover,
#providerUsageSplitPanel::-webkit-scrollbar-thumb:hover,
#quotaWarningPanel::-webkit-scrollbar-thumb:hover,
#billingHistoryPanel::-webkit-scrollbar-thumb:hover,
.pd-scroll-list-small::-webkit-scrollbar-thumb:hover,
.pd-support-case-list::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 31, 229, 0.44);
}

.pd-scroll-list {
  display: grid;
  gap: 10px;
  min-height: 0;
}

.pd-scroll-list-small {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 31, 229, 0.34) rgba(111, 31, 229, 0.06);
}

.pd-provider-split-list {
  display: grid;
  gap: 12px;
}

.pd-provider-split-row {
  padding: 15px;

  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.055), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
}

.pd-provider-split-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.pd-provider-split-top strong {
  color: var(--pd-text-strong);
  font-size: 0.94rem;
  line-height: 1.35;
  font-weight: 900;
}

.pd-provider-split-top span {
  color: var(--pd-purple);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.pd-provider-meter,
.pd-quota-meter {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(111, 31, 229, 0.10);
}

.pd-provider-meter span,
.pd-quota-meter span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background:
    linear-gradient(90deg, var(--pd-purple) 0%, var(--pd-pink) 100%);
}

.pd-provider-split-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pd-provider-split-meta span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;

  padding: 0 9px;
  border-radius: 999px;

  background: #ffffff;
  border: 1px solid rgba(111, 31, 229, 0.12);

  color: var(--pd-muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.pd-quota-panel {
  display: grid;
  gap: 14px;
}

.pd-quota-summary,
.pd-billing-history-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.pd-billing-history-summary {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.pd-quota-summary > div,
.pd-billing-history-summary > div {
  min-width: 0;
  padding: 13px;

  border-radius: 16px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
}

.pd-quota-summary span,
.pd-billing-history-summary span {
  display: block;
  margin-bottom: 6px;

  color: var(--pd-muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pd-quota-summary strong,
.pd-billing-history-summary strong {
  display: block;

  color: var(--pd-text-strong);
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: break-word;
}

/* =========================================================
   SUPPORT CASE LINKING PANEL
========================================================= */

.pd-support-case-summary {
  margin-bottom: 14px;
}

.pd-support-case-row .wd-conversation-meta {
  margin-top: 10px;
}

.pd-mini-link {
  display: inline-flex;
  align-items: center;

  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;

  background: #ffffff;
  border: 1px solid var(--pd-purple-line);

  color: var(--pd-purple);
  font-size: 0.76rem;
  font-weight: 900;
}

.pd-mini-link:hover,
.pd-mini-link:focus-visible {
  border-color: rgba(111, 31, 229, 0.32);
  background: var(--pd-purple-soft);
  outline: none;
}

/* =========================================================
   SUPPORT CASES
========================================================= */

.pd-support-case-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(111, 31, 229, 0.34) rgba(111, 31, 229, 0.06);
}

.pd-support-case-row {
  padding: 16px;

  border-radius: 18px;
  background:
    radial-gradient(circle at 100% 0%, rgba(111, 31, 229, 0.055), transparent 34%),
    linear-gradient(180deg, #ffffff 0%, #fbf9ff 100%);

  border: 1px solid rgba(111, 31, 229, 0.10);
}

.pd-support-case-row + .pd-support-case-row {
  margin-top: 10px;
}

.pd-support-case-row strong {
  display: block;
  margin-bottom: 6px;

  color: var(--pd-text-strong);
  font-size: 0.96rem;
  font-weight: 900;
}

.pd-support-case-row span {
  display: block;

  color: var(--pd-muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

.pd-support-case-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.pd-support-case-meta em {
  display: inline-flex;
  align-items: center;

  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;

  background: var(--pd-purple-soft);
  border: 1px solid var(--pd-purple-line);

  color: var(--pd-purple);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

/* =========================================================
   LOCAL JSON STATUS
========================================================= */

#localJsonStatus[data-status="error"] {
  color: var(--pd-red);
  background: var(--pd-red-soft);
  border: 1px solid var(--pd-red-line);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 850;
}

#localJsonStatus[data-status="success"] {
  color: var(--pd-green);
  background: var(--pd-green-soft);
  border: 1px solid var(--pd-green-line);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 850;
}

#localJsonStatus[data-status="loading"] {
  color: var(--pd-purple);
  background: var(--pd-purple-soft);
  border: 1px solid var(--pd-purple-line);
  padding: 10px 14px;
  border-radius: 14px;
  font-weight: 850;
}

#localJsonStatus[data-status="info"]:empty {
  display: none;
}

/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1360px) {
  .pd-credit-pack-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1260px) {
  .pd-app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .pd-card-grid-three {
    grid-template-columns: 1fr;
  }

  .pd-conversation-layout {
    grid-template-columns: 1fr;
  }

  .pd-conversation-layout > .pd-card:nth-child(2) {
    position: relative;
    top: auto;
    max-height: 72vh;
  }
}

@media (max-width: 1100px) {
  .pd-feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1080px) {
  .pd-stats,
  .pd-card-grid-two {
    grid-template-columns: 1fr 1fr;
  }

  .pd-app-shell {
    grid-template-columns: 1fr;
  }

  .pd-sidebar {
    position: static;
  }
}

@media (max-width: 900px) {
  #billingUsageList,
  #billingAlertList,
  #aiCreditLedgerList,
  #providerUsageSplitPanel,
  #quotaWarningPanel,
  #billingHistoryPanel {
    max-height: 360px;
  }

  .pd-quota-summary,
  .pd-billing-history-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .pd-shell {
    width: min(var(--pd-shell), calc(100% - 22px));
  }

  body.pd-auth-locked .pd-shell {
    width: min(100% - 22px, 1040px);
  }

  .pd-form-grid,
  .pd-detail-grid,
  .pd-mini-grid,
  .pd-stats,
  .pd-card-grid-two,
  .pd-credit-rule-grid,
  .pd-credit-pack-grid,
  .pd-feature-grid {
    grid-template-columns: 1fr;
  }

  .pd-login-card,
  .pd-card,
  .pd-view-head,
  .pd-sidebar-card,
  .pd-utility-bar {
    padding: 20px;
  }

  .pd-login-card {
    border-radius: 24px;
  }

  .pd-login-head h1 {
    font-size: 2rem;
  }

  .pd-btn,
  .pd-form-actions .pd-btn,
  .pd-utility-actions .pd-btn,
  .pd-dashboard-guidance-actions .pd-btn {
    width: 100%;
  }

  .pd-form-actions,
  .pd-utility-actions,
  .pd-dashboard-guidance-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .pd-utility-bar,
  .pd-sidebar-card {
    border-radius: 22px;
  }

  .pd-conversation-layout > .pd-card:nth-child(2) {
    max-height: 68vh;
  }

  .pd-viewer {
    padding-right: 4px;
  }

  .pd-footer-inner {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  body.pd-auth-locked .pd-main {
    padding: 22px 0;
  }

  .pd-login-card,
  .pd-card,
  .pd-view-head,
  .pd-sidebar-card,
  .pd-utility-bar {
    padding: 18px;
  }

  .pd-nav-link {
    min-height: 46px;
    padding: 0 12px;
  }

  .pd-nav-link span {
    width: 30px;
    height: 30px;
  }

  .pd-stat-card strong {
    font-size: 1.25rem;
  }

  .pd-credit-pack {
    min-height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .pd-btn,
  .ai-product-logout,
  .pd-nav-link,
  .wd-conversation-item,
  .pd-credit-pack,
  .pd-field input,
  .pd-usage-toggle {
    transition: none;
  }
}
