@font-face {
  font-family: "Geomanist";
  src: url("https://n8n.io/_nuxt/geomanist-book.7L9Lofdk.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geomanist";
  src: url("https://n8n.io/_nuxt/geomanist-regular.Dpe0kXXD.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --admin-bg: #0d0817;
  --admin-bg-deep: #090510;
  --admin-panel: rgba(20, 15, 31, 0.94);
  --admin-panel-soft: rgba(25, 18, 38, 0.94);
  --admin-panel-strong: rgba(34, 24, 49, 0.96);
  --admin-line: rgba(255, 255, 255, 0.08);
  --admin-line-strong: rgba(255, 255, 255, 0.16);
  --admin-ink: #f6f1ff;
  --admin-muted: #c7bfda;
  --admin-muted-soft: #a89fb8;
  --admin-brand: #ff6d1f;
  --admin-brand-soft: rgba(255, 109, 31, 0.14);
  --admin-violet: #7a5cff;
  --admin-cyan: #32c7d8;
  --admin-success: #49c97b;
  --admin-warn: #ffb56a;
  --admin-danger: #ff7d7d;
  --admin-shadow: 0 28px 70px rgba(0, 0, 0, 0.34);
  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.page-admin {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--admin-ink);
  font-family: "Manrope", "Geomanist", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 78% 8%, rgba(132, 77, 255, 0.22) 0, rgba(132, 77, 255, 0.08) 18%, transparent 38%),
    radial-gradient(circle at 62% 4%, rgba(255, 109, 31, 0.16) 0, rgba(255, 109, 31, 0.06) 16%, transparent 30%),
    linear-gradient(180deg, #130c21 0%, var(--admin-bg) 26%, #0a0712 68%, var(--admin-bg-deep) 100%);
}

body.page-admin::before,
body.page-admin::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

body.page-admin::before {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0) 108px,
      rgba(255, 255, 255, 0.022) 108px,
      rgba(255, 255, 255, 0.022) 109px
    );
  opacity: 0.16;
}

body.page-admin::after {
  inset: auto 0 -18vh 0;
  height: 34vh;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.18) 0, transparent 2px),
    radial-gradient(circle at 48% 12%, rgba(255, 255, 255, 0.14) 0, transparent 1.5px),
    linear-gradient(180deg, rgba(255, 121, 46, 0) 0%, rgba(255, 111, 41, 0.12) 28%, rgba(206, 76, 29, 0.84) 100%);
  background-size: 220px 160px, 240px 180px, auto;
  opacity: 0.7;
}

body.page-admin > *:not(.pb-widget):not(.pb-launcher):not(#page-boot-screen) {
  position: relative;
  z-index: 1;
}

body.page-admin h1,
body.page-admin h2,
body.page-admin h3,
body.page-admin p {
  margin: 0;
}

body.page-admin a,
body.page-admin button,
body.page-admin input,
body.page-admin select,
body.page-admin textarea {
  color: inherit;
  font: inherit;
}

body.page-admin a {
  text-decoration: none;
}

body.page-admin button {
  border: 0;
  cursor: pointer;
}

body.page-admin input[type="number"]::-webkit-outer-spin-button,
body.page-admin input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

body.page-admin input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

body.page-admin a:focus-visible,
body.page-admin button:focus-visible,
body.page-admin input:focus-visible,
body.page-admin select:focus-visible,
body.page-admin textarea:focus-visible,
body.page-admin summary:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.56);
  outline-offset: 4px;
}

.admin-brandbar {
  position: sticky;
  top: 8px;
  z-index: 40;
  padding-top: 10px;
}

.admin-brandbar-inner,
.admin-shell,
.auth-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
}

.admin-brandbar-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: rgba(18, 13, 28, 0.82);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(10px);
}

.admin-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.admin-mark::before {
  content: "";
  width: 28px;
  height: 28px;
  background: center / contain no-repeat url("/static/shared/logo-mark.svg?v=20260303l");
}

.admin-brandnav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.admin-brandnav::-webkit-scrollbar {
  display: none;
}

.admin-navtab,
.admin-navlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--admin-muted);
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.admin-navtab.active,
.admin-navtab:hover,
.admin-navlink:hover {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-ink);
}

.admin-navtab.active {
  background: linear-gradient(135deg, rgba(255, 109, 31, 0.18) 0%, rgba(122, 92, 255, 0.18) 100%);
  border-color: rgba(255, 255, 255, 0.08);
}

.admin-shell {
  display: grid;
  gap: 18px;
  padding: 18px 0 36px;
}

.admin-panel {
  display: grid;
  gap: 18px;
}

.auth-shell {
  position: relative;
  min-height: 94vh;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 40px;
  background: 
    url("/static/shared/admin-auth-bg.png") center / cover no-repeat,
    #0d0817;
}

.auth-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0d0b1a 0%, #111827 100%);
  z-index: 1;
}

.auth-shell::after {
  display: none;
}

.auth-panel {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  width: min(1200px, 100%);
  padding: 40px;
  align-items: center;
}

@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 24px;
    text-align: center;
  }
}

.admin-topbar,
.overview-hero,
.overview-metric,
.overview-graph-card,
.dashboard-card,
.list-card,
.detail-card,
.chart-card,
.breakdown-card,
.info-block,
.config-card,
.catalog-row,
.pricebook-row {
  border: 1px solid var(--admin-line);
  background:
    radial-gradient(circle at top right, rgba(122, 92, 255, 0.1) 0, transparent 32%),
    linear-gradient(180deg, rgba(24, 18, 36, 0.98) 0%, rgba(13, 10, 22, 0.98) 100%);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.28),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.admin-topbar,
.overview-hero,
.dashboard-card,
.list-card,
.detail-card,
.config-card {
  padding: 22px;
  border-radius: var(--radius-xl);
}

.eyebrow,
.badge,
.meta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  align-self: start;
  justify-self: start;
}

.status-pill,
.score-band {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  align-self: start;
  justify-self: start;
}

.admin-topbar,
.workspace-grid,
.overview-grid,
.dashboard-layout,
.dashboard-metrics,
.breakdown-grid,
.lead-desk-shell,
.config-grid,
.catalog-grid,
.catalog-topline,
.catalog-pricing-grid,
.catalog-dual-grid,
.developer-grid,
.topbar-buttons,
.toolbar,
.button-row,
.metric-grid,
.mini-grid,
.hero-metrics,
.hero-tags,
.overview-metrics,
.detail-grid,
.score-parts,
.llm-grid,
.color-grid,
.action-row,
.auth-copy,
.auth-card,
.auth-form,
.auth-highlights,
.session-summary,
.config-tabbar,
.snippet-card,
.snippet-head,
.developer-summary-grid,
.developer-note-list {
  display: grid;
  gap: 14px;
}

.admin-topbar {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 420px);
  align-items: end;
}

.topbar-copy,
.topbar-actions,
.widget-preview-copy,
.form-intro,
.chart-card-head {
  display: grid;
  gap: 10px;
}

.auth-copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: auth-content-fade-in 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes auth-content-fade-in {
  from { opacity: 0; transform: translateX(-30px); }
  to { opacity: 1; transform: translateX(0); }
}

.auth-copy h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.06em;
  color: #fff;
  text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.auth-copy p {
  font-size: 1.2rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.7);
  max-width: 480px;
}

.auth-card {
  padding: 32px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 32px;
  background: rgba(20, 15, 31, 0.45);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 
    0 40px 100px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  animation: auth-card-entrance 1s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes auth-card-entrance {
  from { opacity: 0; transform: translateY(40px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-highlights {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.auth-highlights span {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 20px;
  background: rgba(255,255,255,0.03);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.auth-highlights span:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-2px);
}

.auth-tabs {
  display: flex;
  padding: 6px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 18px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  height: 48px;
  background: transparent;
  border: none;
  border-radius: 14px;
  color: rgba(255,255,255,0.5);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.auth-tab.active {
  background: #fff;
  color: #000;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

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

.auth-form input, 
.auth-form textarea {
  height: 58px;
  padding: 0 24px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 18px;
  color: #fff;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.auth-form textarea {
  height: auto;
  padding: 18px 24px;
}

.auth-form input:focus, 
.auth-form textarea:focus {
  background: rgba(255,255,255,0.08);
  border-color: var(--admin-violet);
  box-shadow: 0 0 0 4px rgba(122, 92, 255, 0.15);
  outline: none;
}

.auth-form .primary-button {
  height: 60px;
  margin-top: 10px;
  font-size: 1.1rem;
  border-radius: 18px;
  background: linear-gradient(135deg, #7a5cff 0%, #ff6d1f 100%);
  box-shadow: 0 20px 40px rgba(122, 92, 255, 0.3);
}

.auth-form .primary-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 25px 50px rgba(122, 92, 255, 0.4);
}

.auth-note {
  margin-top: 24px;
  padding: 20px;
  background: rgba(122, 92, 255, 0.08);
  border: 1px solid rgba(122, 92, 255, 0.2);
  border-radius: 20px;
  text-align: center;
}

.auth-note strong {
  display: block;
  color: var(--admin-violet);
  margin-bottom: 4px;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.auth-note span {
  display: block;
  font-family: inherit;
  color: rgba(255,255,255,0.6);
  font-size: 0.95rem;
}

/* ── Auth redesign ────────────────────────────────────────── */

.auth-brand-mark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
}

.auth-brand-mark img {
  display: block;
}

.auth-copy-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border: 1px solid rgba(122, 92, 255, 0.35);
  border-radius: 999px;
  background: rgba(122, 92, 255, 0.12);
  color: #a093ff;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  width: fit-content;
}

.auth-copy h1 {
  font-size: clamp(2rem, 4.5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.055em;
  color: #fff;
}

.auth-copy p {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.6);
  max-width: 440px;
}

.auth-feature-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
}

.auth-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(73, 201, 123, 0.18);
  border: 1px solid rgba(73, 201, 123, 0.35);
}

.auth-feature-icon::after {
  content: "";
  width: 8px;
  height: 8px;
  background: var(--admin-success);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

/* Card redesign */
.auth-card {
  padding: 36px 32px 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: rgba(16, 12, 26, 0.7);
  backdrop-filter: blur(28px) saturate(160%);
  box-shadow:
    0 40px 90px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  display: flex;
  flex-direction: column;
  gap: 0;
  animation: auth-card-entrance 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Tab redesign */
.auth-tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 16px;
  margin-bottom: 28px;
  border: 1px solid rgba(255,255,255,0.06);
}

.auth-tab {
  flex: 1;
  height: 42px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: rgba(255,255,255,0.45);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: -0.01em;
}

.auth-tab.active {
  background: rgba(255,255,255,0.95);
  color: #0d0817;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

.auth-tab:not(.active):hover {
  color: rgba(255,255,255,0.75);
  background: rgba(255,255,255,0.05);
}

/* Input groups with labels */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.02em;
  padding-left: 2px;
}

.auth-label-optional {
  font-weight: 400;
  color: rgba(255,255,255,0.3);
  font-size: 0.75rem;
}

.auth-input-group input {
  height: 50px;
  padding: 0 18px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: #fff;
  font-size: 0.9rem;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.auth-input-group input::placeholder {
  color: rgba(255,255,255,0.25);
}

.auth-input-group input:focus {
  outline: none;
  background: rgba(255,255,255,0.08);
  border-color: rgba(122, 92, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(122, 92, 255, 0.15);
}

.auth-input-group input:invalid:not(:placeholder-shown) {
  border-color: rgba(255, 125, 125, 0.6);
}

/* Two-column input row */
.auth-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 550px) {
  .auth-input-row {
    grid-template-columns: 1fr;
  }
}

/* CAPTCHA / anti-bot bar */
.auth-captcha-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(73, 201, 123, 0.2);
  border-radius: 12px;
  background: rgba(73, 201, 123, 0.05);
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  transition: border-color 0.3s, background 0.3s;
}

.auth-captcha-bar.verified {
  border-color: rgba(73, 201, 123, 0.4);
  background: rgba(73, 201, 123, 0.08);
  color: rgba(73, 201, 123, 0.85);
}

.auth-captcha-bar.error {
  border-color: rgba(255, 125, 125, 0.4);
  background: rgba(255, 125, 125, 0.07);
  color: rgba(255, 125, 125, 0.8);
}

.auth-captcha-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Submit button */
.auth-submit-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  margin-top: 4px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, #7a5cff 0%, #6046e0 100%);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  box-shadow: 0 12px 28px rgba(122, 92, 255, 0.28);
}

.auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(122, 92, 255, 0.38);
}

.auth-submit-btn:active:not(:disabled) {
  transform: translateY(0);
}

.auth-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Spinner */
.auth-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.6s linear infinite;
}

@keyframes auth-spin {
  to { transform: rotate(360deg); }
}

/* Feedback */
.auth-feedback {
  min-height: 18px;
  font-size: 0.82rem;
  color: var(--admin-danger);
  line-height: 1.5;
  padding-left: 2px;
}

.auth-feedback:empty {
  display: none;
}

.auth-feedback.success {
  color: var(--admin-success);
}

/* Link-style button */
.auth-link-btn {
  background: none;
  border: none;
  padding: 4px 0;
  color: rgba(255,255,255,0.4);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: color 0.2s;
}

.auth-link-btn:hover {
  color: rgba(255,255,255,0.7);
}

/* Ghost button */
.auth-ghost-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.auth-ghost-btn:hover {
  border-color: rgba(255,255,255,0.22);
  background: rgba(255,255,255,0.07);
  color: #fff;
}

/* Sub-form (forgot / reset) */
.auth-sub-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  background: rgba(0,0,0,0.15);
  margin-top: 4px;
}

/* Demo note */
.auth-demo-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(122, 92, 255, 0.18);
  border-radius: 12px;
  background: rgba(122, 92, 255, 0.06);
  margin-top: 4px;
}

.auth-demo-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--admin-violet);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}

.auth-demo-note code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.55);
  background: rgba(255,255,255,0.06);
  padding: 2px 8px;
  border-radius: 6px;
}

/* Security footer */
.auth-security-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 0.73rem;
  color: rgba(255,255,255,0.3);
}

.auth-security-dot {
  width: 7px;
  height: 7px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--admin-success);
  box-shadow: 0 0 8px var(--admin-success);
  animation: auth-dot-pulse 2.5s ease-in-out infinite;
}

@keyframes auth-dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.9); }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 24px 20px;
  }
  .auth-copy {
    text-align: center;
    align-items: center;
  }
  .auth-copy p {
    max-width: 100%;
  }
  .auth-feature-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .auth-feature-list li {
    font-size: 0.82rem;
  }
}

/* ── Auth simple mode: clean and mobile-first ─────────────── */
#auth-shell.auth-shell {
  min-height: 100vh;
  margin: 0;
  padding: 28px 16px;
  border-radius: 0;
  overflow: visible;
  background: #0c1320;
}

#auth-shell.auth-shell::before,
#auth-shell.auth-shell::after {
  display: none;
}

#auth-shell .auth-panel {
  width: min(540px, 100%);
  padding: 0;
  gap: 0;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  #auth-shell .auth-panel {
    width: min(600px, 100%);
  }
}

@media (min-width: 1024px) {
  #auth-shell .auth-panel {
    width: 700px;
  }
}

#auth-shell .auth-copy {
  display: none;
}

#auth-shell .auth-card {
  width: 100%;
  padding: 22px;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #0f1a2e;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.25);
  backdrop-filter: none;
  animation: none;
}

#auth-shell .auth-back-home {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  padding: 8px 12px;
  border: none;
  background: transparent;
  color: #64748b;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s ease;
}

#auth-shell .auth-back-home:hover {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.08);
}

#auth-shell .auth-back-arrow {
  display: inline-flex;
  font-size: 16px;
}

#auth-shell .auth-tabs {
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: #101c31;
}

#auth-shell .auth-tab {
  height: 40px;
  color: rgba(226, 232, 240, 0.86);
}

#auth-shell .auth-tab.active {
  color: #f8fafc;
  background: #1d4ed8;
  box-shadow: none;
}

#auth-shell .auth-input-group label,
#auth-shell .auth-label-optional,
#auth-shell .auth-link-btn,
#auth-shell .auth-security-footer {
  color: #94a3b8;
}

#auth-shell .auth-input-group input {
  height: 46px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: #0b1424;
  color: #e2e8f0;
}

#auth-shell .auth-input-group input::placeholder {
  color: #64748b;
}

#auth-shell .auth-input-group input:focus {
  background: #0b1424;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

#auth-shell .auth-submit-btn {
  height: 48px;
  border-radius: 10px;
  background: #2563eb;
  box-shadow: none;
}

#auth-shell .auth-submit-btn:hover:not(:disabled) {
  transform: none;
  box-shadow: none;
  background: #1d4ed8;
}

#auth-shell .auth-captcha-bar,
#auth-shell .auth-sub-form,
#auth-shell .auth-demo-note {
  border-radius: 10px;
  border-color: rgba(148, 163, 184, 0.24);
  background: #0b1424;
}

#auth-shell .auth-demo-note code {
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
}

@media (max-width: 640px) {
  #auth-shell.auth-shell {
    padding: 14px;
  }

  #auth-shell .auth-card {
    padding: 16px;
    border-radius: 14px;
  }

  #auth-shell .auth-input-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}
/* ── end auth redesign ──────────────────────────────────────── */

.session-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topbar-copy h1,
.section-head h2,
.compact-head h2,
.overview-hero h2,
.chart-card-head h3,
.widget-preview-copy h3,
.overview-graph-card h2,
.developer-note-card h3 {
  font-family: "Sora", "Geomanist", "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: -0.04em;
}

.topbar-copy h1 {
  max-width: 16ch;
  font-size: clamp(1.72rem, 2.45vw, 2.18rem);
  line-height: 1.02;
}

.topbar-copy p {
  max-width: 68ch;
}

.topbar-copy p,
.overview-hero p,
.compact-head p,
.chart-card-head p,
.detail-card p,
.empty-state,
.empty-list,
.ops-intro,
.form-feedback,
.pricebook-row p,
.message p,
.estimate-box p,
.catalog-row p,
.form-intro p {
  color: var(--admin-muted);
  line-height: 1.7;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-meta span,
.hero-tags span,
.stack-list span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted);
}

.topbar-actions {
  align-items: stretch;
}

.topbar-field,
.tenant-form label,
.color-grid label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
}

.topbar-buttons {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.primary-button,
.secondary-button,
.ghost-button,
.ghost-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, #ff7d31 0%, #ff6123 52%, #ff4f1b 100%);
  box-shadow:
    0 14px 30px rgba(255, 96, 40, 0.22),
    0 1px 0 rgba(255, 255, 255, 0.1) inset;
}

.secondary-button {
  border-color: var(--admin-line-strong);
  background: rgba(255, 255, 255, 0.06);
  color: var(--admin-ink);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
}

.ghost-button,
.ghost-link {
  border-color: var(--admin-line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--admin-ink);
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin-top: 8px;
  font-size: clamp(1.26rem, 2.1vw, 1.68rem);
  line-height: 1.04;
}

.compact-head {
  margin-bottom: 18px;
}

.compact-head h2 {
  margin-top: 8px;
  font-size: 1.42rem;
  line-height: 1;
}

.configuration-head p {
  max-width: 620px;
  color: var(--admin-muted);
}

.config-tabbar {
  grid-template-columns: repeat(4, minmax(0, max-content));
  align-items: center;
}

.workspace-grid-single,
.config-grid-single {
  grid-template-columns: 1fr;
}

.config-grid-single .config-card {
  max-width: 920px;
}

.overview-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(420px, 0.9fr);
}

.overview-side-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.overview-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 260px;
  background:
    radial-gradient(circle at 82% 18%, rgba(255, 109, 31, 0.18) 0, transparent 24%),
    radial-gradient(circle at 56% 26%, rgba(122, 92, 255, 0.22) 0, transparent 28%),
    linear-gradient(180deg, rgba(28, 20, 43, 0.98) 0%, rgba(15, 11, 24, 0.98) 100%);
}

.overview-hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -60px auto;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.08) 0, rgba(255, 255, 255, 0) 70%);
}

.overview-hero > .eyebrow {
  margin-bottom: 4px;
}

.overview-hero h2 {
  position: relative;
  z-index: 1;
  max-width: 12ch;
  font-size: clamp(1.62rem, 2.45vw, 2.3rem);
  line-height: 1;
}

.overview-hero p,
.hero-metrics,
.hero-tags {
  position: relative;
  z-index: 1;
}

.hero-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
}

.hero-metrics div,
.overview-metric,
.metric-grid div,
.mini-grid div {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(29, 22, 43, 0.92), rgba(18, 14, 29, 0.92));
}

.hero-metrics div::before,
.overview-metric::before,
.metric-grid div::before {
  content: "";
  position: absolute;
  inset: auto -12% -34px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 109, 31, 0.16) 0, rgba(255, 109, 31, 0) 72%);
}

.hero-metrics strong,
.overview-metric strong,
.metric-grid strong,
.mini-grid strong {
  position: relative;
  display: block;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: -0.05em;
}

.hero-metrics span,
.overview-metric span,
.metric-grid span,
.mini-grid span {
  position: relative;
  display: block;
  margin-top: 8px;
  color: var(--admin-muted);
}

.overview-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
}

.overview-metric {
  min-height: 124px;
}

.overview-graph-card {
  padding: 18px;
  border-radius: var(--radius-lg);
}

/* ─── Quick-start onboarding guide ─────────────────────────────────────── */
.quick-start-card {
  padding: 22px 24px 24px;
  border-top: 3px solid var(--admin-accent, #3757ff);
  position: relative;
}

/* Header row */
.qs-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.qs-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 4px 0 0;
  line-height: 1.25;
}
.qs-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-top: 4px;
}
.qs-progress-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--admin-ink-muted, #64748b);
  white-space: nowrap;
}
.qs-dismiss {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--admin-line, rgba(148,163,184,0.18));
  border-radius: 6px;
  background: transparent;
  color: var(--admin-ink-muted, #64748b);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.qs-dismiss:hover {
  background: var(--admin-surface-raised, rgba(148,163,184,0.1));
  color: var(--admin-ink, #1e293b);
}

/* Progress bar */
.qs-progress-track {
  height: 4px;
  border-radius: 99px;
  background: var(--admin-line, rgba(148,163,184,0.18));
  margin-bottom: 18px;
  overflow: hidden;
}
.qs-progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--admin-accent, #3757ff);
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

/* Step list */
.quick-start-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.quick-start-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--admin-line, rgba(148,163,184,0.12));
  transition: opacity 0.25s;
}
.quick-start-step:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.quick-start-step.is-done {
  opacity: 0.4;
}
.quick-start-step.is-current {
  opacity: 1;
}

/* Numbered badge */
.qs-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--admin-accent, #3757ff);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: "IBM Plex Mono", monospace;
  transition: background 0.2s;
}
.quick-start-step.is-done .qs-badge {
  background: #22c55e;
}
.quick-start-step.is-done .qs-badge .qs-badge-num {
  font-size: 0;
}
.quick-start-step.is-done .qs-badge::after {
  content: "✓";
  font-size: 0.75rem;
}
.qs-badge-demo {
  background: var(--admin-surface-raised, #f1f5f9);
  color: var(--admin-ink, #1e293b);
  border: 1px solid var(--admin-line, rgba(148,163,184,0.22));
}

/* Step icon */
.qs-step-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
}
.qs-svg-icon {
  width: 20px;
  height: 20px;
  display: block;
  flex-shrink: 0;
  color: var(--admin-accent, #3757ff);
}
.quick-start-step.is-done .qs-svg-icon {
  color: #22c55e;
}
.qs-step-demo .qs-svg-icon {
  color: var(--admin-ink-muted, #64748b);
}

/* Step body */
.qs-step-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.qs-step-body strong {
  font-size: 0.875rem;
  font-weight: 600;
}
.qs-step-body span {
  font-size: 0.75rem;
  color: var(--admin-ink-muted, #64748b);
}

/* Action button */
.qs-action-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius, 7px);
  border: 1px solid var(--admin-accent, #3757ff);
  background: transparent;
  color: var(--admin-accent, #3757ff);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.qs-action-btn:hover {
  background: var(--admin-accent, #3757ff);
  color: #fff;
}
.qs-action-demo {
  border-color: var(--admin-line, rgba(148,163,184,0.3));
  color: var(--admin-ink-muted, #64748b);
}
.qs-action-demo:hover {
  background: var(--admin-surface-raised, #f1f5f9);
  color: var(--admin-ink, #1e293b);
}
.quick-start-step.is-done .qs-action-btn {
  pointer-events: none;
  opacity: 0.5;
}

/* Highlight pulse for anchor-scroll target */
@keyframes qs-highlight-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(55,87,255,0); }
  40% { box-shadow: 0 0 0 6px rgba(55,87,255,0.22); }
}
.qs-highlight {
  animation: qs-highlight-pulse 1.6s ease;
  border-radius: var(--radius, 7px);
}

.overview-snapshot-chart,
.overview-live-categories {
  display: grid;
  gap: 14px;
}

.overview-snapshot-svg {
  width: 100%;
  height: auto;
  display: block;
}

.overview-guides line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}

.overview-point circle {
  fill: #ffffff;
  stroke: #7a5cff;
  stroke-width: 2;
}

.overview-point text {
  fill: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-snapshot-legend {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.overview-snapshot-legend span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.overview-snapshot-legend strong {
  color: var(--admin-ink);
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}

.overview-snapshot-caption {
  color: var(--admin-muted);
  line-height: 1.6;
}

.overview-live-categories {
  display: flex;
  flex-wrap: wrap;
}

.workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.lead-desk-shell {
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  align-items: start;
}

.list-card,
.detail-card,
.chart-card,
.breakdown-card,
.info-block,
.config-card {
  border-radius: var(--radius-lg);
}

.toolbar {
  grid-template-columns: minmax(0, 1.7fr) repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

select,
input,
textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--admin-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

select {
  appearance: none;
  -webkit-appearance: none;
  color-scheme: dark;
  padding-right: 42px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--admin-muted) 50%),
    linear-gradient(135deg, var(--admin-muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

select option,
select optgroup {
  color: var(--admin-ink);
  background: #17141f;
}

select option:disabled {
  color: var(--admin-muted-soft);
  background: #120e1c;
}

select:disabled,
input:disabled,
textarea:disabled {
  opacity: 0.58;
  cursor: not-allowed;
}

textarea {
  min-height: 112px;
  padding-top: 12px;
  padding-bottom: 12px;
  resize: vertical;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow:
    0 0 0 4px rgba(122, 92, 255, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.lead-list,
.message-list,
.pricebook-list,
.catalog-list {
  display: grid;
  gap: 12px;
}

.lead-list {
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: 4px;
}

.lead-row,
.catalog-row {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(29, 22, 43, 0.92), rgba(18, 14, 29, 0.92));
  text-align: left;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.lead-row.active,
.lead-row:hover,
.catalog-row.active,
.catalog-row:hover {
  border-color: rgba(255, 109, 31, 0.3);
  background: linear-gradient(180deg, rgba(38, 29, 54, 0.98), rgba(20, 15, 31, 0.98));
  transform: translateY(-1px);
}

.lead-row-head,
.lead-row-body,
.lead-row-meta,
.lead-row-foot,
.chart-copy,
.service-bar-head,
.pricebook-row > div,
.catalog-row-head,
.catalog-row-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.lead-row-head,
.catalog-row-head {
  align-items: center;
  margin-bottom: 10px;
}

.lead-row-body,
.lead-row-meta,
.lead-row-foot,
.catalog-row p,
.catalog-row-meta {
  color: var(--admin-muted);
  font-size: 0.92rem;
}

.lead-row-body {
  margin-bottom: 12px;
}

.lead-row-summary {
  margin-bottom: 12px;
  color: var(--admin-muted-soft);
  font-size: 0.88rem;
  line-height: 1.5;
}

.lead-row-body strong,
.lead-row-head strong,
.catalog-row-head strong {
  color: var(--admin-ink);
}

.lead-row-meta,
.catalog-row-meta {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.meta-pill {
  min-height: 28px;
  padding: 0 9px;
}

.meta-pill.action {
  border-color: rgba(122, 92, 255, 0.26);
  background: rgba(122, 92, 255, 0.14);
  color: #ddd5ff;
}

.meta-pill.ready {
  border-color: rgba(73, 201, 123, 0.22);
  background: rgba(73, 201, 123, 0.1);
  color: #d8ffe6;
}

.meta-pill.followup {
  border-color: rgba(255, 181, 106, 0.24);
  background: rgba(255, 181, 106, 0.1);
  color: #ffe4bf;
}

.meta-pill.outside {
  border-color: rgba(255, 125, 125, 0.24);
  background: rgba(255, 125, 125, 0.1);
  color: #ffd9d9;
}

.meta-pill.clarity-strong {
  border-color: rgba(50, 199, 216, 0.26);
  background: rgba(50, 199, 216, 0.1);
  color: #d4fbff;
}

.meta-pill.clarity-medium {
  border-color: rgba(122, 92, 255, 0.24);
  background: rgba(122, 92, 255, 0.1);
  color: #e2dcff;
}

.meta-pill.clarity-weak {
  border-color: rgba(255, 181, 106, 0.24);
  background: rgba(255, 181, 106, 0.1);
  color: #ffe1bc;
}

.meta-pill.contact-ok,
.badge.hot,
.score-band.hot {
  border-color: rgba(73, 201, 123, 0.22);
  background: rgba(73, 201, 123, 0.12);
  color: #bcffd5;
}

.meta-pill.contact-missing,
.badge.alert {
  border-color: rgba(255, 125, 125, 0.22);
  background: rgba(255, 125, 125, 0.12);
  color: #ffd0d0;
}

.badge.warm,
.score-band.warm {
  border-color: rgba(255, 181, 106, 0.24);
  background: rgba(255, 181, 106, 0.12);
  color: #ffd9aa;
}

.badge.cold,
.score-band.cold {
  border-color: rgba(122, 92, 255, 0.26);
  background: rgba(122, 92, 255, 0.14);
  color: #ddd5ff;
}

.badge.neutral,
.score-band.neutral,
.badge.off {
  background: rgba(255, 255, 255, 0.06);
  color: var(--admin-muted);
}

.lead-row-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.mini-flag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted);
  font-size: 0.78rem;
  font-weight: 600;
}

.mini-flag.warn {
  border-color: rgba(255, 181, 106, 0.24);
  background: rgba(255, 181, 106, 0.08);
  color: #ffe1bc;
}

.empty-state,
.empty-list {
  padding: 24px;
  border: 1px dashed var(--admin-line-strong);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.hidden {
  display: none !important;
}

.detail-card {
  position: sticky;
  top: 96px;
}

.detail-content {
  display: grid;
  gap: 18px;
}

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

.info-block,
.chart-card,
.breakdown-card {
  padding: 18px;
}

.info-block h3,
.breakdown-card h3 {
  margin-bottom: 14px;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

dl div {
  display: grid;
  gap: 4px;
}

dt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--admin-muted-soft);
}

dd {
  margin: 0;
  font-weight: 700;
  line-height: 1.58;
}

.score-box {
  display: grid;
  gap: 14px;
}

.score-summary {
  display: grid;
  gap: 10px;
}

.score-total {
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 800;
}

.score-total small {
  font-size: 1rem;
  color: var(--admin-muted);
}

.score-reason {
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.score-parts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.score-parts span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted);
  font-size: 0.86rem;
}

.score-parts strong {
  color: var(--admin-ink);
  font-size: 1rem;
}

.score-box ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--admin-muted);
}

.analysis-grid {
  align-items: start;
}

.analysis-box,
.analysis-summary,
.analysis-metrics,
.analysis-note-stack,
.handoff-stack,
.tag-list {
  display: grid;
  gap: 12px;
}

.analysis-summary,
.analysis-note-stack,
.handoff-stack > div {
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.analysis-summary p,
.analysis-note-stack p,
.analysis-notes,
.handoff-stack strong {
  color: var(--admin-ink);
  line-height: 1.58;
}

.analysis-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.analysis-metric {
  display: grid;
  gap: 4px;
  min-height: 88px;
  padding: 14px;
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.analysis-metric span,
.analysis-label {
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.analysis-metric strong {
  font-size: 1rem;
  line-height: 1.35;
}

.analysis-metric.good {
  border-color: rgba(73, 201, 123, 0.22);
  background: rgba(73, 201, 123, 0.08);
}

.analysis-metric.warn {
  border-color: rgba(255, 181, 106, 0.22);
  background: rgba(255, 181, 106, 0.08);
}

.analysis-metric.neutral {
  border-color: rgba(122, 92, 255, 0.2);
  background: rgba(122, 92, 255, 0.08);
}

.analysis-notes {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: var(--admin-muted);
}

.handoff-stack strong {
  display: block;
}

.tag-list {
  grid-template-columns: repeat(auto-fit, minmax(140px, max-content));
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.tag.good {
  border-color: rgba(73, 201, 123, 0.22);
  background: rgba(73, 201, 123, 0.08);
  color: #d5ffe4;
}

.tag.warn {
  border-color: rgba(255, 181, 106, 0.24);
  background: rgba(255, 181, 106, 0.08);
  color: #ffe3c5;
}

.action-row {
  grid-template-columns: 190px 170px minmax(180px, 1fr) 140px;
}

.estimate-box {
  display: grid;
  gap: 10px;
}

.estimate-box strong {
  display: block;
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.estimate-box span,
.stack-list strong {
  color: #ffd4c1;
  font-weight: 700;
}

.message {
  padding: 14px 16px;
  border: 1px solid var(--admin-line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.message span {
  display: inline-flex;
  margin-bottom: 8px;
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.message.user {
  background: rgba(255, 109, 31, 0.12);
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.message-attachment-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-attachment-block {
  width: min(260px, 100%);
  padding: 8px;
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: rgba(9, 15, 28, 0.65);
  display: grid;
  gap: 6px;
}

.message-attachment-block img,
.message-attachment-block video {
  width: 100%;
  max-height: 220px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--admin-line);
  background: rgba(4, 8, 16, 0.9);
}

.message-attachment-block audio {
  width: 100%;
}

.message-attachment-meta,
.message-attachment-caption {
  margin: 0;
  color: var(--admin-muted-soft);
  font-size: 0.72rem;
  line-height: 1.35;
}

.dashboard-card,
.dashboard-metrics {
  display: grid;
  gap: 18px;
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  align-items: start;
}

.metric-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mini-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chart-card-head h3 {
  margin-top: 8px;
  font-size: 1.3rem;
  line-height: 1;
}

.funnel-chart,
.service-bars {
  display: grid;
  gap: 12px;
}

.chart-row,
.service-bar {
  display: grid;
  gap: 8px;
}

.chart-copy strong,
.service-bar-head strong {
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.chart-copy span,
.service-bar-head span {
  color: var(--admin-muted);
  font-size: 0.82rem;
}

.chart-track,
.service-bar-track {
  overflow: hidden;
  height: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.chart-fill,
.service-bar-fill {
  display: block;
  height: 100%;
  width: var(--bar-size, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--admin-brand) 0%, #ff4522 100%);
}

.chart-fill.pending,
.service-bar-fill.new {
  background: linear-gradient(90deg, #6d6677 0%, #8c8399 100%);
}

.chart-fill.hot,
.service-bar-fill.hot {
  background: linear-gradient(90deg, #49c97b 0%, #75e8a0 100%);
}

.chart-fill.warm,
.service-bar-fill.nurturing,
.service-bar-fill.warm {
  background: linear-gradient(90deg, #ffb56a 0%, #ffd0a1 100%);
}

.chart-fill.cold,
.service-bar-fill.discarded,
.service-bar-fill.cold {
  background: linear-gradient(90deg, #7a5cff 0%, #bbaeff 100%);
}

.chart-fill.contacted,
.service-bar-fill.contacted,
.service-bar-fill.closed {
  background: linear-gradient(90deg, #32c7d8 0%, #8df0ff 100%);
}

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

.stack-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.configuration-shell,
.config-card,
.tenant-form,
.catalog-form {
  display: grid;
  gap: 18px;
}

.config-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.channels-grid,
.channel-status-grid,
.pairing-card,
.pairing-shell,
.pairing-meta,
.qr-demo-empty,
.meta-checklist,
.meta-check-copy,
.meta-tools-grid,
.meta-tool-card,
.meta-reply-preview {
  display: grid;
  gap: 16px;
}

.channels-grid {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: start;
}

.channel-status-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.channel-status-card,
.pairing-card {
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.03);
}

.channel-status-card strong,
.pairing-copy h3 {
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.channel-status-card p,
.pairing-copy p,
.pairing-meta span {
  color: var(--admin-muted);
}

.pairing-shell {
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  align-items: center;
}

.pairing-meta {
  gap: 10px;
}

.qr-demo-card {
  min-height: 220px;
  padding: 12px;
  border: 1px solid var(--admin-line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 109, 31, 0.14) 0, transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
}

.qr-demo-card svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-real-wrap {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-height: 194px;
  padding: 10px;
  text-align: center;
}

.qr-real-wrap svg {
  display: block;
  width: min(100%, 180px);
  height: auto;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.24);
}

.qr-real-code,
.qr-real-brand,
.qr-real-note {
  display: block;
}

.qr-real-code {
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.qr-real-brand {
  color: var(--admin-ink);
  font-size: 0.86rem;
  font-weight: 600;
}

.qr-real-note {
  color: var(--admin-muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.qr-demo-empty {
  align-content: center;
  justify-items: start;
  min-height: 194px;
  padding: 18px;
}

.button-row.inline-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.meta-check-item,
.meta-tool-card,
.meta-reply-preview {
  padding: 14px 16px;
  border: 1px solid var(--admin-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
}

.meta-check-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.meta-check-index,
.meta-check-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.meta-check-index {
  min-width: 28px;
  padding: 0;
  border: 1px solid var(--admin-line);
  color: var(--admin-muted-soft);
}

.meta-check-copy strong,
.meta-tool-card h4,
.meta-reply-preview strong {
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}

.meta-check-copy span,
.meta-tool-card p,
.meta-reply-preview p {
  color: var(--admin-muted);
  line-height: 1.6;
}

.meta-check-item.done .meta-check-state {
  background: rgba(88, 208, 129, 0.18);
  color: #b9f0c6;
}

.meta-check-item.pending .meta-check-state {
  background: rgba(255, 180, 66, 0.16);
  color: #ffd08a;
}

.meta-tools-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.meta-tool-card input,
.meta-tool-card textarea {
  width: 100%;
}

.meta-reply-preview {
  gap: 8px;
  background:
    radial-gradient(circle at top right, rgba(122, 92, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.03);
}

.config-card-wide {
  grid-column: 1 / -1;
}

.catalog-grid {
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  align-items: start;
}

.catalog-list {
  max-height: 760px;
  overflow: auto;
  padding-right: 4px;
}

.catalog-topline {
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
}

.catalog-pricing-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.catalog-dual-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-row {
  display: grid;
  gap: 10px;
}

.catalog-row-head code {
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.75rem;
}

.catalog-row-meta {
  margin-bottom: 0;
}

.pricebook-row {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.pricebook-row span {
  color: var(--admin-muted);
}

.snippet-card {
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
}

.snippet-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.snippet-card textarea {
  min-height: 132px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
  line-height: 1.55;
}

.llm-grid,
.color-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-feedback {
  min-height: 24px;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--admin-line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.03);
  color: var(--admin-muted);
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--admin-brand);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.button-row > .primary-button,
.button-row > .secondary-button,
.button-row > .ghost-button,
.button-row > .ghost-link {
  min-width: 180px;
}

.widget-preview-card {
  display: grid;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--admin-line);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(circle at 84% 10%, rgba(122, 92, 255, 0.16) 0, transparent 28%),
    linear-gradient(180deg, rgba(23, 17, 34, 0.98) 0%, rgba(14, 10, 23, 0.98) 100%);
}

.widget-preview-copy h3 {
  font-size: 1.24rem;
}

.widget-preview-host {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 109, 31, 0.1) 0, transparent 26%),
    linear-gradient(180deg, rgba(14, 10, 23, 0.98) 0%, rgba(9, 6, 17, 0.98) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.widget-preview-host > * {
  position: relative;
  z-index: 2;
}

.widget-preview-host::before {
  content: "Preview widget";
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 3;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  pointer-events: none;
}

.widget-preview-host::after {
  content: "";
  position: absolute;
  inset: 88px 24px 24px 24px;
  z-index: 1;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025) 0%, rgba(255, 255, 255, 0.01) 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.developer-card summary {
  list-style: none;
  cursor: pointer;
  display: grid;
  gap: 8px;
}

.developer-card summary::-webkit-details-marker {
  display: none;
}

.developer-card[open] summary {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--admin-line);
}

.developer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  align-items: start;
}

.developer-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.developer-note-card {
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at top right, rgba(122, 92, 255, 0.14), transparent 40%),
    linear-gradient(180deg, rgba(24, 18, 36, 0.98) 0%, rgba(13, 10, 22, 0.98) 100%);
  box-shadow:
    0 24px 54px rgba(0, 0, 0, 0.24),
    0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.developer-note-card,
.field-stack {
  display: grid;
  gap: 10px;
}

.developer-preset-strip,
.developer-advanced-stack {
  display: grid;
  gap: 12px;
}

.developer-preset-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.developer-preset-strip .config-tab {
  justify-content: center;
  min-height: 38px;
  padding-inline: 14px;
  font-size: 0.84rem;
  border-radius: 999px;
  align-self: start;
  flex: 0 0 auto;
}

.developer-toggle {
  justify-self: start;
  align-self: start;
  min-height: 38px;
  padding-inline: 14px;
  border-radius: 999px;
}

.developer-advanced-stack {
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.developer-note-card h3 {
  font-size: 1.08rem;
  letter-spacing: -0.03em;
}

.developer-note-card p {
  color: var(--admin-muted);
  line-height: 1.65;
}

.developer-note-list {
  grid-template-columns: repeat(auto-fit, minmax(180px, max-content));
}

.developer-note-list span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--admin-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.field-stack {
  font-size: 0.9rem;
  font-weight: 700;
}

.field-stack span {
  color: var(--admin-muted-soft);
}

@media (max-width: 1240px) {
  .auth-panel,
  .overview-grid,
  .dashboard-layout,
  .lead-desk-shell,
  .catalog-grid,
  .channels-grid,
  .config-grid,
  .developer-grid,
  .developer-summary-grid {
    grid-template-columns: 1fr;
  }

  .config-card-wide {
    grid-column: auto;
  }

  .overview-snapshot-legend {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-card {
    position: static;
  }
}

@media (max-width: 980px) {
  .admin-brandbar-inner,
  .admin-shell,
  .auth-shell {
    width: min(100% - 24px, 1320px);
  }

  .admin-brandbar-inner,
  .auth-highlights,
  .admin-topbar,
  .channel-status-grid,
  .hero-metrics,
  .overview-metrics,
  .overview-snapshot-legend,
  .metric-grid,
  .mini-grid,
  .breakdown-grid,
  .detail-grid,
  .analysis-metrics,
  .score-parts,
  .toolbar,
  .button-row,
  .action-row,
  .catalog-topline,
  .catalog-pricing-grid,
  .catalog-dual-grid,
  .meta-tools-grid,
  .llm-grid,
  .color-grid,
  .topbar-buttons,
  .session-summary,
  .config-tabbar {
    grid-template-columns: 1fr;
  }

  .section-head,
  .lead-row-head,
  .lead-row-body,
  .lead-row-meta,
  .lead-row-foot,
  .chart-copy,
  .service-bar-head,
  .pricebook-row > div,
  .catalog-row-head,
  .catalog-row-meta {
    flex-direction: column;
    align-items: flex-start;
  }

  .pairing-shell {
    grid-template-columns: 1fr;
  }

  .meta-check-item,
  .button-row.inline-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .admin-brandbar-inner {
    grid-template-columns: 1fr;
    justify-items: start;
    gap: 12px;
    padding: 16px 18px;
  }

  .admin-brandnav {
    justify-content: flex-start;
  }

  .admin-shell {
    padding: 12px 0 26px;
    gap: 14px;
  }

  .auth-panel {
    padding: 16px;
    border-radius: 20px;
  }

  .admin-topbar,
  .overview-hero,
  .dashboard-card,
  .list-card,
  .detail-card,
  .config-card,
  .auth-card {
    padding: 16px;
    border-radius: 18px;
  }

  .topbar-copy h1,
  .section-head h2,
  .overview-hero h2 {
    max-width: none;
    font-size: clamp(1.55rem, 7vw, 2.2rem);
  }

  .widget-preview-host {
    min-height: 520px;
  }
}

#admin-app .pricebook-import-panel {
  gap: 14px;
}

#admin-app .pricebook-file-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #ffffff;
}

#admin-app #pricebook-import {
  min-height: 210px;
  border-radius: 16px;
}

#admin-app #pricebook-preview {
  border: 1px solid #d8e4f1;
  border-radius: 16px;
  padding: 14px;
  background: #f8fbff;
}

#admin-app #pricebook-preview ul {
  margin: 0;
  padding-left: 18px;
}

#admin-app .ops-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#admin-app .ops-suggestion-list,
#admin-app .ops-voice-list {
  display: grid;
  gap: 8px;
}

#admin-app .ops-suggestion {
  justify-content: flex-start;
  text-align: left;
}

#admin-app .ops-voice-row {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid #d8e4f1;
  border-radius: 12px;
  background: #ffffff;
}

#admin-app .quick-quote-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #d7e3f1;
  border-radius: 14px;
  background: #f8fbff;
}

/* Final polish layer: strict symmetry, spacing rhythm and state badges */
#admin-app .lead-list {
  max-height: min(76vh, 980px);
  overflow: auto;
  padding-right: 6px;
}

#admin-app .lead-list::-webkit-scrollbar {
  width: 10px;
}

#admin-app .lead-list::-webkit-scrollbar-thumb {
  background: #c7d6e8;
  border-radius: 999px;
  border: 2px solid #f5f8fc;
}

#admin-app .lead-list::-webkit-scrollbar-track {
  background: #eef3f9;
  border-radius: 999px;
}

#admin-app .lead-toolbar {
  gap: 14px;
  padding: 14px;
  border: 1px solid #d8e3ef;
  border-radius: 16px;
  background: #fbfdff;
}

#admin-app .lead-toolbar-search input,
#admin-app .lead-toolbar-filters select,
#admin-app .action-row input,
#admin-app .action-row select {
  min-height: 44px;
  border-radius: 12px;
}

#admin-app .lead-toolbar-actions,
#admin-app .button-row.inline-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#admin-app .button-row.inline-actions > button,
#admin-app .lead-toolbar-actions > button {
  width: 100%;
  min-height: 44px;
}

#admin-app .action-row {
  grid-template-columns: 1.05fr 0.85fr 1.2fr 0.9fr;
  gap: 10px;
}

#admin-app .meta-check-item {
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d8e3ef;
  border-radius: 14px;
  background: #ffffff;
}

#admin-app .meta-check-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #cbd8e8;
  color: #4f5f75;
  font-weight: 700;
}

#admin-app .meta-check-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

#admin-app .meta-check-state.ok {
  border: 1px solid #9ed7b5;
  background: #ecf9f0;
  color: #1f7a45;
}

#admin-app .meta-check-state.todo {
  border: 1px solid #f3c48f;
  background: #fff5e9;
  color: #9a5815;
}

#admin-app .pricebook-layout {
  align-items: start;
  gap: 18px;
}

#admin-app .pricebook-import-panel,
#admin-app .pricebook-list-shell {
  border: 1px solid #d9e4f0;
  border-radius: 18px;
  padding: 16px;
  background: #fbfdff;
}

#admin-app .pricebook-import-panel .button-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

#admin-app .pricebook-import-panel .button-row > button {
  min-height: 44px;
}

@media (max-width: 1180px) {
  #admin-app .lead-toolbar-actions,
  #admin-app .button-row.inline-actions,
  #admin-app .pricebook-import-panel .button-row {
    grid-template-columns: 1fr;
  }
  #admin-app .action-row {
    grid-template-columns: 1fr;
  }
}

/* Final override block (keep at end): prevents later legacy rules from breaking symmetry */
#admin-app .lead-toolbar { gap: 14px !important; padding: 14px !important; border: 1px solid #d8e3ef !important; border-radius: 16px !important; background: #fbfdff !important; }
#admin-app .lead-toolbar-actions,
#admin-app .button-row.inline-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
#admin-app .action-row { grid-template-columns: 1.05fr 0.85fr 1.2fr 0.9fr !important; gap: 10px !important; }
#admin-app .meta-check-state.ok { border: 1px solid #9ed7b5 !important; background: #ecf9f0 !important; color: #1f7a45 !important; }
#admin-app .meta-check-state.todo { border: 1px solid #f3c48f !important; background: #fff5e9 !important; color: #9a5815 !important; }
#admin-app .pricebook-import-panel .button-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
#admin-app .pricebook-file-input { width: 100% !important; min-height: 44px !important; padding: 10px 12px !important; border: 1px solid #d8e3ef !important; border-radius: 14px !important; background: #fff !important; }

@media (max-width: 1180px) {
  #admin-app .lead-toolbar-actions,
  #admin-app .button-row.inline-actions,
  #admin-app .pricebook-import-panel .button-row,
  #admin-app .action-row {
    grid-template-columns: 1fr !important;
  }
}

/* Z-Final hard overrides: keep last */
#admin-app {
  padding-bottom: max(84px, env(safe-area-inset-bottom)) !important;
}

#admin-app .configuration-shell,
#admin-app .lead-desk-shell,
#admin-app .workspace-grid,
#admin-app .overview-grid {
  padding-bottom: 18px !important;
}

#admin-app .channels-config-card,
#admin-app .channels-live-card,
#admin-app .config-card,
#admin-app .detail-card {
  padding-bottom: 22px !important;
}

#admin-app #channels-form > .button-row,
#admin-app .pricebook-import-panel > .button-row,
#admin-app .channels-actions-row,
#admin-app .button-row.inline-actions {
  margin-top: 4px !important;
  margin-bottom: 8px !important;
}

#admin-app .lead-toolbar-actions {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
}

#admin-app .pricebook-file-input {
  overflow: hidden !important;
  line-height: 1.2 !important;
}

#admin-app .pricebook-file-input::file-selector-button {
  margin-right: 12px;
  border: 1px solid #d0dbea;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fd 100%);
  color: #1f2d3d;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

/* Ultimate full-panel polish override (all admin tabs) */
#admin-app .admin-panel {
  gap: 20px !important;
}

#admin-app .section-head,
#admin-app .section-head.compact-head,
#admin-app .channels-section-head,
#admin-app .configuration-head {
  display: grid !important;
  gap: 8px !important;
  align-items: start !important;
}

#admin-app .section-head h2,
#admin-app .section-head h3 {
  margin: 0 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.015em !important;
}

#admin-app .topbar-copy p,
#admin-app .section-head p,
#admin-app .ops-intro,
#admin-app .channels-mode-note,
#admin-app .form-intro p {
  margin: 0 !important;
  line-height: 1.52 !important;
}

#admin-app .overview-hero,
#admin-app .overview-graph-card,
#admin-app .dashboard-card,
#admin-app .list-card,
#admin-app .detail-card,
#admin-app .config-card,
#admin-app .channel-status-card,
#admin-app .pairing-card,
#admin-app .meta-tool-card,
#admin-app .meta-reply-preview,
#admin-app .pricebook-import-panel,
#admin-app .pricebook-list-shell,
#admin-app .catalog-list-pane .catalog-row,
#admin-app .widget-preview-card {
  border: 1px solid #dbe5f0 !important;
  border-radius: 18px !important;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05) !important;
}

#admin-app .list-card,
#admin-app .detail-card,
#admin-app .config-card,
#admin-app .dashboard-card {
  padding: 18px !important;
}

#admin-app .status-pill {
  min-height: 28px !important;
  padding: 0 10px !important;
  border: 1px solid #d3deeb !important;
  border-radius: 999px !important;
  font-size: 0.7rem !important;
  letter-spacing: 0.09em !important;
}

#admin-app .tenant-form input,
#admin-app .tenant-form select,
#admin-app .tenant-form textarea,
#admin-app .toolbar input,
#admin-app .toolbar select,
#admin-app .meta-tool-card input,
#admin-app .meta-tool-card textarea {
  min-height: 46px !important;
  border: 1px solid #d5e0ed !important;
  border-radius: 14px !important;
  padding: 11px 13px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74) !important;
}

#admin-app textarea {
  min-height: 118px !important;
  line-height: 1.45 !important;
}

#admin-app .button-row,
#admin-app .topbar-buttons,
#admin-app .channels-actions-row {
  gap: 10px !important;
}

#admin-app .primary-button,
#admin-app .secondary-button,
#admin-app .ghost-button,
#admin-app .danger-button {
  min-height: 44px !important;
  border-radius: 13px !important;
  font-size: 0.9rem !important;
  font-weight: 600 !important;
  padding: 0 14px !important;
}

#admin-app .button-row > .primary-button,
#admin-app .button-row > .secondary-button,
#admin-app .button-row > .ghost-button,
#admin-app .button-row > .danger-button {
  width: 100% !important;
}

#admin-app .catalog-grid,
#admin-app .channels-grid,
#admin-app .pricebook-layout {
  gap: 16px !important;
}

#admin-app .catalog-list-pane {
  gap: 10px !important;
  padding: 8px !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 16px !important;
  background: #f8fbff !important;
}

#admin-app .catalog-list-pane .catalog-row {
  margin: 0 !important;
  padding: 14px !important;
}

#admin-app .catalog-list-pane .catalog-row.active {
  border-color: #fdba8c !important;
  box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.2), 0 12px 24px rgba(15, 23, 42, 0.06) !important;
}

#admin-app .pricebook-import-panel .button-row,
#admin-app .channels-actions-row,
#admin-app .button-row.inline-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

#admin-app .meta-checklist {
  gap: 10px !important;
}

#admin-app .meta-check-item {
  display: grid !important;
  grid-template-columns: auto 1fr auto !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: 70px !important;
  padding: 12px 14px !important;
}

#admin-app .meta-check-index {
  width: 30px !important;
  height: 30px !important;
  border: 1px solid #c8d6e6 !important;
  border-radius: 999px !important;
  font-size: 0.78rem !important;
  font-weight: 700 !important;
}

#admin-app .meta-check-copy span {
  line-height: 1.45 !important;
}

#admin-app .meta-check-state {
  min-width: 52px !important;
  justify-content: center !important;
  border-radius: 999px !important;
  padding: 5px 10px !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
}

#admin-app .meta-check-state.ok {
  border: 1px solid #9ed7b5 !important;
  background: #ecf9f0 !important;
  color: #1f7a45 !important;
}

#admin-app .meta-check-state.todo {
  border: 1px solid #f3c48f !important;
  background: #fff5e9 !important;
  color: #9a5815 !important;
}

#admin-app .lead-toolbar-actions {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
}

#admin-app .lead-list {
  border: 1px solid #dbe5f0 !important;
  border-radius: 14px !important;
  padding: 6px !important;
}

#admin-app .lead-list::-webkit-scrollbar {
  width: 10px;
}

#admin-app .lead-list::-webkit-scrollbar-thumb {
  border: 2px solid #f3f7fc;
  border-radius: 999px;
  background: #b7c6d7;
}

#admin-app .lead-list::-webkit-scrollbar-track {
  background: #f3f7fc;
}

#admin-app .widget-preview-host {
  border-radius: 16px !important;
  border: 1px solid #dbe5f0 !important;
}

#admin-app .topbar-buttons > button,
#admin-app .topbar-buttons > a {
  min-width: 110px !important;
}

@media (max-width: 1180px) {
  #admin-app .pricebook-import-panel .button-row,
  #admin-app .channels-actions-row,
  #admin-app .button-row.inline-actions,
  #admin-app .topbar-buttons {
    grid-template-columns: 1fr !important;
  }
}

/* Bottom safety + final action visibility */
#admin-app {
  padding-bottom: max(84px, env(safe-area-inset-bottom)) !important;
}

#admin-app .configuration-shell,
#admin-app .lead-desk-shell,
#admin-app .workspace-grid,
#admin-app .overview-grid {
  padding-bottom: 18px !important;
}

#admin-app .channels-config-card,
#admin-app .channels-live-card,
#admin-app .config-card,
#admin-app .detail-card {
  padding-bottom: 22px !important;
}

#admin-app #channels-form > .button-row,
#admin-app .pricebook-import-panel > .button-row,
#admin-app .channels-actions-row,
#admin-app .button-row.inline-actions {
  margin-top: 4px !important;
  margin-bottom: 8px !important;
}

/* Native file input refinement (Catalogo import) */
#admin-app .pricebook-file-input {
  overflow: hidden !important;
  line-height: 1.2 !important;
}

#admin-app .pricebook-file-input::file-selector-button {
  margin-right: 12px;
  border: 1px solid #d0dbea;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fd 100%);
  color: #1f2d3d;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .primary-button,
  .secondary-button,
  .ghost-button,
  .ghost-link,
  .lead-row,
  .catalog-row {
    transition: none;
  }
}

/* Clean dashboard override: visually separate the CRM from the marketing site */
:root {
  color-scheme: light;
  --admin-bg: #f3f6fb;
  --admin-bg-deep: #edf2f8;
  --admin-panel: #ffffff;
  --admin-panel-soft: #fbfcfe;
  --admin-panel-strong: #f8fafc;
  --admin-line: #e3e8f1;
  --admin-line-strong: #d4dce8;
  --admin-ink: #101828;
  --admin-muted: #5f6b7a;
  --admin-muted-soft: #7b8794;
  --admin-brand: #2f6df6;
  --admin-brand-soft: rgba(47, 109, 246, 0.1);
  --admin-violet: #5b7cff;
  --admin-cyan: #0ea5e9;
  --admin-success: #16a34a;
  --admin-warn: #d97706;
  --admin-danger: #dc2626;
  --admin-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

body.page-admin {
  color: var(--admin-ink);
  background:
    radial-gradient(circle at top left, rgba(47, 109, 246, 0.08) 0, transparent 24%),
    linear-gradient(180deg, #f7f9fc 0%, var(--admin-bg) 42%, var(--admin-bg-deep) 100%);
}

body.page-admin::before,
body.page-admin::after {
  display: none;
}

body.page-admin a:focus-visible,
body.page-admin button:focus-visible,
body.page-admin input:focus-visible,
body.page-admin select:focus-visible,
body.page-admin textarea:focus-visible,
body.page-admin summary:focus-visible {
  outline: 2px solid rgba(47, 109, 246, 0.28);
  outline-offset: 3px;
}

.admin-brandbar {
  top: 0;
  padding-top: 14px;
}

.admin-brandbar-inner {
  min-height: 68px;
  border-color: var(--admin-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

.admin-mark {
  color: #0f172a;
  font-weight: 700;
}

.admin-navtab,
.admin-navlink {
  border-color: transparent;
  background: transparent;
  color: var(--admin-muted);
  font-weight: 600;
}

.admin-navtab.active,
.admin-navtab:hover,
.admin-navlink:hover {
  border-color: #dbe3ef;
  background: #f7f9fc;
  color: #0f172a;
}

.admin-navtab.active {
  border-color: rgba(47, 109, 246, 0.16);
  background: linear-gradient(180deg, rgba(47, 109, 246, 0.12) 0%, rgba(47, 109, 246, 0.08) 100%);
  color: #1d4ed8;
}

.admin-topbar,
.overview-hero,
.overview-metric,
.overview-graph-card,
.dashboard-card,
.list-card,
.detail-card,
.chart-card,
.breakdown-card,
.info-block,
.config-card,
.catalog-row,
.pricebook-row,
.developer-note-card {
  border-color: var(--admin-line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 252, 255, 0.98) 100%);
  box-shadow: var(--admin-shadow);
}

.topbar-copy h1,
.section-head h2,
.compact-head h2,
.overview-hero h2,
.chart-card-head h3,
.widget-preview-copy h3,
.overview-graph-card h2,
.developer-note-card h3 {
  color: #0f172a;
}

.topbar-copy p,
.overview-hero p,
.compact-head p,
.chart-card-head p,
.detail-card p,
.empty-state,
.empty-list,
.ops-intro,
.form-feedback,
.pricebook-row p,
.message p,
.estimate-box p,
.catalog-row p,
.form-intro p,
.configuration-head p,
.overview-snapshot-caption,
.developer-note-card p {
  color: var(--admin-muted);
}

.eyebrow,
.badge,
.meta-pill,
.status-pill,
.score-band {
  border-color: var(--admin-line);
  background: #f7f9fc;
  color: var(--admin-muted-soft);
}

.topbar-meta span,
.hero-tags span,
.stack-list span,
.developer-note-list span,
.mini-flag,
.tag,
.message-attachment-chip {
  border-color: var(--admin-line);
  background: #f8fafc;
  color: var(--admin-muted);
}

.admin-topbar {
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 420px);
  align-items: start;
}

.topbar-copy {
  gap: 12px;
}

.topbar-copy h1 {
  max-width: 15ch;
  font-size: clamp(1.9rem, 2.6vw, 2.5rem);
  line-height: 0.98;
}

.topbar-meta {
  gap: 10px;
}

.topbar-actions {
  padding: 4px;
  border: 1px solid var(--admin-line);
  border-radius: 20px;
  background: #f8fafc;
}

.topbar-field {
  color: #334155;
}

.topbar-buttons {
  grid-template-columns: repeat(2, minmax(160px, 1fr));
}

.primary-button {
  background: linear-gradient(180deg, #2f6df6 0%, #2457d6 100%);
  box-shadow:
    0 12px 24px rgba(47, 109, 246, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.secondary-button {
  border-color: var(--admin-line-strong);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.ghost-button,
.ghost-link {
  border-color: var(--admin-line);
  background: #f8fafc;
  color: #334155;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.09);
}

select,
input,
textarea {
  border-color: #d7dfeb;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

select {
  background-image:
    linear-gradient(45deg, transparent 50%, #667085 50%),
    linear-gradient(135deg, #667085 50%, transparent 50%);
}

select option,
select optgroup {
  color: #0f172a;
  background: #ffffff;
}

select option:disabled {
  color: var(--admin-muted-soft);
  background: #f8fafc;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(47, 109, 246, 0.42);
  box-shadow:
    0 0 0 4px rgba(47, 109, 246, 0.1),
    0 1px 2px rgba(15, 23, 42, 0.03);
}

.overview-hero {
  min-height: 292px;
  background:
    radial-gradient(circle at top right, rgba(47, 109, 246, 0.1) 0, transparent 28%),
    radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.08) 0, transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.overview-hero::after {
  inset: auto -5% -70px auto;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(47, 109, 246, 0.08) 0, rgba(47, 109, 246, 0) 70%);
}

.hero-metrics div,
.overview-metric,
.metric-grid div,
.mini-grid div,
.score-parts span,
.analysis-summary,
.analysis-note-stack,
.handoff-stack > div,
.score-reason,
.analysis-metric,
.snippet-card,
.meta-check-item,
.meta-tool-card,
.meta-reply-preview,
.toggle-field,
.pricebook-row,
.lead-row,
.catalog-row {
  border-color: var(--admin-line);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.hero-metrics div::before,
.overview-metric::before,
.metric-grid div::before {
  background: radial-gradient(circle, rgba(47, 109, 246, 0.08) 0, rgba(47, 109, 246, 0) 72%);
}

.hero-metrics strong,
.overview-metric strong,
.metric-grid strong,
.mini-grid strong,
.score-total,
.estimate-box strong {
  color: #0f172a;
}

.chart-track,
.service-bar-track {
  border-color: #e2e8f0;
  background: #eff4fb;
}

.chart-fill,
.service-bar-fill {
  background: linear-gradient(90deg, #2f6df6 0%, #4d8bff 100%);
}

.chart-fill.pending,
.service-bar-fill.new {
  background: linear-gradient(90deg, #94a3b8 0%, #cbd5e1 100%);
}

.chart-fill.hot,
.service-bar-fill.hot {
  background: linear-gradient(90deg, #16a34a 0%, #4ade80 100%);
}

.chart-fill.warm,
.service-bar-fill.nurturing,
.service-bar-fill.warm {
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}

.chart-fill.cold,
.service-bar-fill.discarded,
.service-bar-fill.cold {
  background: linear-gradient(90deg, #64748b 0%, #94a3b8 100%);
}

.chart-fill.contacted,
.service-bar-fill.contacted,
.service-bar-fill.closed {
  background: linear-gradient(90deg, #0ea5e9 0%, #38bdf8 100%);
}

.lead-row.active,
.lead-row:hover,
.catalog-row.active,
.catalog-row:hover {
  border-color: rgba(47, 109, 246, 0.26);
  background: #f9fbff;
}

.lead-row-body,
.lead-row-meta,
.lead-row-foot,
.catalog-row p,
.catalog-row-meta,
.chart-copy span,
.service-bar-head span,
.pricebook-row span,
.tag,
.analysis-label,
dt {
  color: var(--admin-muted);
}

.lead-row-head strong,
.lead-row-body strong,
.catalog-row-head strong,
dd,
.analysis-summary p,
.analysis-note-stack p,
.handoff-stack strong,
.meta-check-copy strong,
.meta-tool-card h4,
.meta-reply-preview strong {
  color: #0f172a;
}

.meta-pill.action,
.badge.cold,
.score-band.cold {
  border-color: rgba(47, 109, 246, 0.18);
  background: rgba(47, 109, 246, 0.08);
  color: #1d4ed8;
}

.meta-pill.ready,
.badge.hot,
.score-band.hot,
.tag.good,
.analysis-metric.good {
  border-color: rgba(22, 163, 74, 0.16);
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
}

.meta-pill.followup,
.badge.warm,
.score-band.warm,
.tag.warn,
.analysis-metric.warn,
.mini-flag.warn {
  border-color: rgba(217, 119, 6, 0.16);
  background: rgba(217, 119, 6, 0.08);
  color: #92400e;
}

.meta-pill.outside,
.meta-pill.contact-missing,
.badge.alert {
  border-color: rgba(220, 38, 38, 0.16);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.meta-pill.contact-ok,
.meta-pill.clarity-strong {
  border-color: rgba(14, 165, 233, 0.16);
  background: rgba(14, 165, 233, 0.08);
  color: #075985;
}

.meta-pill.clarity-medium,
.analysis-metric.neutral {
  border-color: rgba(100, 116, 139, 0.16);
  background: rgba(100, 116, 139, 0.08);
  color: #334155;
}

.message {
  border-color: var(--admin-line);
  background: #f8fafc;
}

.message.user {
  background: #eef4ff;
}

.widget-preview-card {
  border-color: var(--admin-line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.widget-preview-copy h3 {
  color: #0f172a;
}

.widget-preview-host {
  border-color: #dbe3ef;
  background:
    radial-gradient(circle at 18% 12%, rgba(47, 109, 246, 0.08) 0, transparent 26%),
    linear-gradient(180deg, #eaf0fb 0%, #dde7f7 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.widget-preview-host::before {
  border-color: rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.74);
  color: #64748b;
}

.widget-preview-host::after {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.2) 100%);
  border-color: rgba(15, 23, 42, 0.06);
}

.developer-card {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.developer-summary-grid,
.developer-grid {
  gap: 18px;
}

.developer-note-card {
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.developer-preset-strip .config-tab,
.auth-tab,
.config-tab,
.developer-toggle {
  border-color: #dbe3ef;
  background: #ffffff;
  color: #475467;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.developer-preset-strip .config-tab.active,
.auth-tab.active,
.config-tab.active {
  border-color: rgba(47, 109, 246, 0.18);
  background: rgba(47, 109, 246, 0.08);
  color: #1d4ed8;
}

.developer-advanced-stack {
  border-top-color: var(--admin-line);
}

.auth-panel,
.auth-card {
  border-color: var(--admin-line);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: var(--admin-shadow);
}

.auth-highlights span,
.auth-note {
  border-color: var(--admin-line);
  background: #ffffff;
}

@media (max-width: 980px) {
  .topbar-buttons {
    grid-template-columns: 1fr;
  }

  .developer-summary-grid {
    grid-template-columns: 1fr;
  }
}

/* Enterprise dashboard override */
body.page-admin {
  color-scheme: light;
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 109, 246, 0.08) 0, transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(14, 165, 233, 0.08) 0, transparent 18%),
    linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
}

body.page-admin::before,
body.page-admin::after {
  display: none;
}

body.page-admin a:focus-visible,
body.page-admin button:focus-visible,
body.page-admin input:focus-visible,
body.page-admin select:focus-visible,
body.page-admin textarea:focus-visible,
body.page-admin summary:focus-visible {
  outline: 2px solid rgba(47, 109, 246, 0.38);
  outline-offset: 3px;
}

.admin-brandbar {
  top: 0;
  padding-top: 14px;
}

.admin-brandbar-inner,
.admin-shell,
.auth-shell {
  width: min(1440px, calc(100% - 40px));
}

.admin-brandbar-inner {
  min-height: 64px;
  padding: 10px 16px;
  border: 1px solid #dbe4ef;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(18px);
}

.admin-mark {
  color: #0f172a;
  font-weight: 700;
}

.admin-brandnav {
  justify-content: flex-start;
  gap: 6px;
}

.admin-navtab,
.admin-navlink {
  min-height: 40px;
  padding: 0 15px;
  border-radius: 12px;
  color: #516173;
  font-size: 0.88rem;
  font-weight: 600;
}

.admin-navtab:hover,
.admin-navlink:hover {
  border-color: #dce5ef;
  background: #f7f9fc;
  color: #0f172a;
}

.admin-navtab.active {
  border-color: #cadafc;
  background: #edf4ff;
  color: #2157d8;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.admin-shell {
  gap: 18px;
  padding: 22px 0 42px;
}

.admin-panel {
  gap: 18px;
}

.admin-topbar,
.overview-hero,
.dashboard-card,
.list-card,
.detail-card,
.config-card,
.overview-graph-card,
.developer-note-card {
  border: 1px solid #dde6f0;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.06);
}

.admin-topbar {
  padding: 24px 26px;
  grid-template-columns: minmax(0, 1.38fr) 330px;
  align-items: start;
}

.topbar-copy {
  gap: 14px;
}

.eyebrow,
.badge,
.meta-pill,
.status-pill,
.score-band {
  min-height: 28px;
  padding: 0 10px;
  border-color: #e1e7ef;
  background: #f5f7fb;
  color: #66768a;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.topbar-copy h1 {
  max-width: 18ch;
  font-size: clamp(1.92rem, 2.35vw, 2.42rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.topbar-copy p,
.overview-hero p,
.compact-head p,
.chart-card-head p,
.detail-card p,
.empty-state,
.empty-list,
.ops-intro,
.form-feedback,
.pricebook-row p,
.message p,
.estimate-box p,
.catalog-row p,
.form-intro p,
.configuration-head p,
.overview-snapshot-caption,
.developer-note-card p {
  color: #64748b;
}

.topbar-copy p {
  max-width: 62ch;
  font-size: 0.95rem;
  line-height: 1.6;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-meta span,
.hero-tags span,
.stack-list span,
.developer-note-list span,
.mini-flag,
.tag,
.message-attachment-chip {
  min-height: 32px;
  padding: 0 12px;
  border-color: #e3e9f1;
  background: #f8fafc;
  color: #516173;
  font-size: 0.76rem;
  font-weight: 600;
}

.topbar-actions {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e4ebf3;
  border-radius: 20px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
  align-content: start;
}

.session-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topbar-field {
  display: grid;
  gap: 8px;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 700;
}

.topbar-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.topbar-buttons > * {
  width: 100%;
}

#refresh-button {
  grid-column: 1 / -1;
}

#logout-button {
  grid-column: 1 / -1;
}

.primary-button,
.secondary-button,
.ghost-button,
.ghost-link {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.primary-button {
  background: linear-gradient(180deg, #2f6df6 0%, #2252cf 100%);
  box-shadow:
    0 12px 24px rgba(47, 109, 246, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.18) inset;
}

.secondary-button {
  border-color: #dbe4ef;
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.ghost-button,
.ghost-link {
  border-color: #e1e8f1;
  background: #f5f7fb;
  color: #475569;
}

.primary-button:hover,
.secondary-button:hover,
.ghost-button:hover,
.ghost-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.09);
}

input,
select,
textarea {
  border-color: #d7e0ea;
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  box-shadow: none;
}

input,
select {
  min-height: 46px;
  padding: 0 14px;
}

textarea {
  padding: 12px 14px;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%2364758B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  padding-right: 42px;
}

select::-ms-expand {
  display: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: rgba(47, 109, 246, 0.48);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.1);
}

.overview-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 18px;
  align-items: start;
}

.overview-side-panel {
  display: grid;
  gap: 16px;
}

.overview-hero {
  padding: 26px;
  min-height: 0;
  gap: 18px;
  align-content: start;
  background: linear-gradient(135deg, #ffffff 0%, #fbfcfe 58%, #f5f9ff 100%);
}

.overview-hero::after {
  display: none;
}

.overview-hero h2 {
  max-width: 11ch;
  font-size: clamp(1.95rem, 2.35vw, 2.45rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
  color: #0f172a;
}

.overview-hero p {
  max-width: 60ch;
  font-size: 0.95rem;
  line-height: 1.64;
}

.hero-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.overview-metrics {
  gap: 12px;
}

.hero-metrics div,
.overview-metric,
.metric-grid div,
.mini-grid div,
.score-parts span,
.analysis-summary,
.analysis-note-stack,
.handoff-stack > div,
.score-reason,
.analysis-metric,
.snippet-card,
.meta-check-item,
.meta-tool-card,
.meta-reply-preview,
.toggle-field,
.pricebook-row,
.lead-row,
.catalog-row {
  position: relative;
  padding: 18px;
  border-color: #e4ebf3;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.hero-metrics div::before,
.overview-metric::before,
.metric-grid div::before {
  width: 72px;
  height: 72px;
  inset: auto 10px 10px auto;
  background: radial-gradient(circle, rgba(47, 109, 246, 0.08) 0, rgba(47, 109, 246, 0) 72%);
}

.hero-metrics strong,
.overview-metric strong,
.metric-grid strong,
.mini-grid strong,
.score-total,
.estimate-box strong {
  color: #0f172a;
}

.hero-metrics strong,
.overview-metric strong {
  font-size: 1.62rem;
  font-weight: 800;
}

.hero-metrics span,
.overview-metric span {
  margin-top: 6px;
  font-size: 0.82rem;
  color: #64748b;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.overview-graph-card {
  padding: 20px;
}

.section-head {
  margin-bottom: 16px;
}

.section-head h2,
.compact-head h2,
.overview-graph-card h2,
.developer-note-card h3 {
  color: #0f172a;
}

.section-head h2 {
  font-size: clamp(1.18rem, 1.8vw, 1.44rem);
}

.overview-snapshot-chart,
.overview-live-categories {
  border: 1px solid #e6edf5;
  border-radius: 18px;
  background: #f8fafc;
}

.overview-snapshot-chart {
  padding: 16px;
}

.overview-snapshot-legend span {
  padding: 10px 12px;
}

.overview-live-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px;
}

.overview-live-categories > * {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #dde6f0;
  border-radius: 12px;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 600;
}

.dashboard-card,
.config-card,
.list-card,
.detail-card {
  padding: 22px;
}

.configuration-head {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  align-items: end;
  gap: 18px;
  margin-bottom: 18px;
}

.configuration-head p {
  justify-self: end;
  max-width: 44ch;
  font-size: 0.93rem;
  line-height: 1.6;
}

.developer-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.developer-note-card {
  min-height: 176px;
  padding: 18px 20px;
  gap: 10px;
}

.developer-note-card h3 {
  font-size: 1.08rem;
  line-height: 1.15;
}

.developer-note-card p {
  font-size: 0.92rem;
  line-height: 1.6;
}

.developer-note-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.config-card.developer-card {
  padding: 14px;
  background: linear-gradient(180deg, #f9fbff 0%, #f5f8fc 100%);
}

.developer-grid {
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  gap: 16px;
  margin-top: 0;
}

.developer-grid > form {
  padding: 20px;
  border: 1px solid #dde6f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.04);
}

.form-intro {
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #edf2f7;
}

.form-intro p {
  max-width: none;
  font-size: 0.92rem;
}

.developer-preset-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.developer-preset-strip .config-tab,
.auth-tab,
.config-tab,
.developer-toggle {
  min-height: 36px;
  padding-inline: 12px;
  border-color: #dbe4ef;
  border-radius: 12px;
  background: #f8fafc;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 700;
  box-shadow: none;
}

.developer-preset-strip .config-tab.active,
.auth-tab.active,
.config-tab.active {
  border-color: #cadafc;
  background: #edf4ff;
  color: #2157d8;
}

.developer-toggle {
  justify-self: start;
}

.developer-advanced-stack {
  border-top-color: #edf2f7;
}

.field-stack {
  gap: 7px;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 700;
}

.field-stack input,
.field-stack textarea,
.field-stack select {
  min-height: 46px;
}

.llm-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button-row > .primary-button,
.button-row > .secondary-button,
.button-row > .ghost-button,
.button-row > .ghost-link {
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  flex: 0 0 auto;
}

.widget-preview-host::before,
.widget-preview-host::after {
  content: none;
}

@media (max-width: 1120px) {
  .admin-topbar,
  .overview-grid,
  .developer-grid,
  .developer-summary-grid,
  .configuration-head {
    grid-template-columns: 1fr;
  }

  .configuration-head p {
    justify-self: start;
    max-width: none;
  }

  .topbar-copy h1,
  .overview-hero h2 {
    max-width: none;
  }
}

@media (max-width: 980px) {
  .admin-brandbar-inner,
  .admin-shell,
  .auth-shell {
    width: min(100% - 24px, 1440px);
  }

  .topbar-buttons,
  .hero-metrics,
  .llm-grid {
    grid-template-columns: 1fr;
  }

  #refresh-button {
    grid-column: auto;
  }
}

/* Section-by-section admin refinement */
input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

select option,
select optgroup {
  color: #0f172a;
  background: #ffffff;
}

select,
.toolbar select,
.action-row select,
.topbar-field select {
  border-color: #d3dde8;
  background:
    linear-gradient(180deg, #ffffff 0%, #fcfdff 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none'%3E%3Cpath d='M3 5.25L7 9.25L11 5.25' stroke='%2364758B' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      no-repeat right 14px center / 14px 14px;
  color: #334155;
  font-weight: 600;
  line-height: 1.2;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.75) inset,
    0 4px 12px rgba(15, 23, 42, 0.03);
}

.primary-button,
.primary-button:visited,
.primary-button:hover,
.primary-button:focus-visible {
  color: #ffffff;
}

body.page-admin button.primary-button,
body.page-admin a.primary-button,
body.page-admin .primary-button,
body.page-admin .primary-button:visited,
body.page-admin .primary-button:hover,
body.page-admin .primary-button:focus-visible,
body.page-admin .primary-button:active,
body.page-admin .primary-button * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff;
}

select:hover,
input:hover,
textarea:hover {
  border-color: #c6d3e0;
}

.config-grid,
.channels-grid,
.catalog-grid,
.developer-grid {
  align-items: start;
}

.lead-desk-shell {
  grid-template-columns: minmax(430px, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
}

.toolbar {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

#search-input {
  grid-column: 1 / -1;
  min-width: 240px;
  font-weight: 600;
}

#filter-button,
#reset-button {
  min-width: 96px;
  padding-inline: 14px;
}

.lead-list {
  max-height: calc(100vh - 332px);
}

.action-row {
  grid-template-columns: minmax(160px, 182px) auto minmax(210px, 1fr) auto;
  gap: 10px;
}

.channels-grid {
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  gap: 18px;
}

#channels-form .toggle-field {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 14px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

#channels-form .toggle-field span {
  color: #334155;
  font-weight: 600;
  line-height: 1.5;
}

#channels-form .toggle-field input {
  margin: 0;
}

.channel-status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pairing-card,
.meta-tool-card {
  gap: 18px;
}

.catalog-grid {
  grid-template-columns: minmax(330px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
}

.catalog-topline {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.catalog-pricing-grid {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
  gap: 10px;
}

.catalog-dual-grid {
  gap: 12px;
}

#service-template-form textarea {
  min-height: 98px;
}

#theme-form {
  gap: 14px;
}

.color-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.widget-preview-card {
  padding: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f7fd 100%);
}

.widget-preview-host {
  min-height: 420px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 16% 12%, rgba(47, 109, 246, 0.08) 0, transparent 24%),
    linear-gradient(180deg, #edf3fa 0%, #e3ebf7 100%);
}

.snippet-card textarea {
  min-height: 96px;
}

#llm-form .button-row,
#theme-form .button-row,
#service-template-form .button-row {
  align-items: stretch;
}

.danger-button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #f1c6cf;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff5f7 0%, #fdecef 100%);
  color: #b42318;
  font-weight: 700;
  letter-spacing: -0.01em;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.danger-button:hover {
  transform: translateY(-1px);
  border-color: #e9a9b6;
  box-shadow: 0 12px 24px rgba(180, 35, 24, 0.08);
}

.danger-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#catalogo .ops-intro {
  max-width: 62ch;
  line-height: 1.65;
}

#catalogo .catalog-grid {
  grid-template-columns: minmax(360px, 0.86fr) minmax(440px, 1.14fr);
  gap: 20px;
}

.catalog-list-pane {
  padding: 8px;
  border: 1px solid #dde6f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #f2f6fc 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.catalog-list-pane .catalog-row {
  padding: 18px;
  border: 1px solid #d7e1ec;
  border-radius: 20px;
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 10px 20px rgba(15, 23, 42, 0.04);
}

.catalog-list-pane .catalog-row:hover {
  border-color: #bed2ea;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 16px 28px rgba(15, 23, 42, 0.07);
}

.catalog-list-pane .catalog-row.active {
  border-color: #2f6df6;
  box-shadow:
    0 0 0 3px rgba(47, 109, 246, 0.12),
    0 18px 30px rgba(47, 109, 246, 0.12);
}

.catalog-list-pane .catalog-row-head {
  align-items: flex-start;
}

.catalog-list-pane .catalog-row-head strong {
  font-size: 1.12rem;
  line-height: 1.2;
}

.catalog-list-pane .catalog-row p {
  margin: 0;
}

.catalog-list-pane .catalog-row code {
  color: #607189;
  font-size: 0.82rem;
}

.catalog-list-pane .catalog-row-meta {
  gap: 8px;
  margin-bottom: 0;
}

.catalog-row-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-row-foot span {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #e3eaf2;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  background: #f8fafc;
  color: #64748b;
  font-size: 0.76rem;
  font-weight: 700;
}

.catalog-editor-form {
  position: sticky;
  top: 104px;
  align-self: start;
  padding: 22px;
  border: 1px solid #dde6f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

#service-template-form .button-row {
  padding-top: 2px;
}

#service-template-form .button-row > * {
  min-width: 138px;
}

#pricebook-import {
  min-height: 220px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.6;
}

.pricebook-list {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.pricebook-layout {
  grid-template-columns: minmax(320px, 0.78fr) minmax(0, 1.22fr);
  gap: 18px;
  align-items: start;
}

.pricebook-import-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.pricebook-list-shell {
  padding: 8px;
  border: 1px solid #dde6f0;
  border-radius: 22px;
  background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%);
}

.pricebook-row {
  padding: 16px 18px;
  border: 1px solid #dde6f0;
  background: #ffffff;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.04);
}

.pricebook-row > div {
  align-items: flex-start;
}

.pricebook-row strong {
  color: #0f172a;
}

.pricebook-row p {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid #edf2f7;
}

@media (max-width: 1380px) {
  .catalog-pricing-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 1180px) {
  .lead-desk-shell,
  .channels-grid,
  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .catalog-editor-form {
    position: static;
    top: auto;
  }

  .pricebook-layout {
    grid-template-columns: 1fr;
  }

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

  .action-row {
    grid-template-columns: 1fr 1fr;
  }

  #assign-input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 860px) {
  .toolbar,
  .action-row,
  .catalog-pricing-grid,
  .color-grid,
  .channel-status-grid,
  .meta-tools-grid {
    grid-template-columns: 1fr;
  }

  #search-input {
    grid-column: auto;
  }
}

body.page-admin {
  --admin-font-body: "Manrope", "Geomanist", "Segoe UI", sans-serif;
  --admin-font-display: "Manrope", "Geomanist", "Segoe UI", sans-serif;
  --admin-font-mono: "IBM Plex Mono", monospace;
}

.admin-mark,
.admin-navtab,
.admin-navlink,
.primary-button,
.secondary-button,
.ghost-button,
.ghost-link,
input,
select,
textarea,
.topbar-field,
.tenant-form label,
.color-grid label {
  font-family: var(--admin-font-body);
}

.topbar-copy h1,
.auth-copy h1,
.overview-hero h2,
.section-head h2,
.compact-head h2,
.overview-graph-card h2,
.chart-card-head h3,
.widget-preview-copy h3,
.developer-note-card h3,
.configuration-head h2 {
  font-family: var(--admin-font-display);
  letter-spacing: -0.042em;
}

.admin-mark {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.028em;
}

.admin-navtab,
.admin-navlink {
  min-height: 42px;
  padding: 0 16px;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.eyebrow,
.badge,
.meta-pill,
.status-pill,
.score-band {
  font-family: var(--admin-font-mono);
  min-height: 26px;
  padding: 0 9px;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.topbar-copy h1 {
  max-width: 18ch;
  font-size: clamp(1.76rem, 2.12vw, 2.18rem);
  line-height: 1.04;
  font-weight: 800;
}

.auth-copy h1 {
  max-width: 13ch;
  font-size: clamp(2rem, 2.7vw, 2.62rem);
  line-height: 0.98;
  font-weight: 800;
}

.overview-hero h2 {
  max-width: 13ch;
  font-size: clamp(1.78rem, 2.1vw, 2.16rem);
  line-height: 1.02;
  font-weight: 800;
}

.section-head h2 {
  margin-top: 6px;
  font-size: clamp(1.12rem, 1.45vw, 1.34rem);
  line-height: 1.12;
  font-weight: 750;
}

.compact-head h2,
.overview-graph-card h2,
.chart-card-head h3,
.widget-preview-copy h3,
.developer-note-card h3,
.configuration-head h2 {
  font-size: clamp(1.04rem, 1.3vw, 1.24rem);
  line-height: 1.14;
  font-weight: 750;
}

.topbar-copy p,
.overview-hero p,
.compact-head p,
.chart-card-head p,
.detail-card p,
.empty-state,
.empty-list,
.ops-intro,
.form-feedback,
.pricebook-row p,
.message p,
.estimate-box p,
.catalog-row p,
.form-intro p,
.configuration-head p,
.overview-snapshot-caption,
.developer-note-card p,
.auth-copy p,
.auth-note span {
  font-size: 0.96rem;
  line-height: 1.62;
}

.topbar-field,
.tenant-form label,
.color-grid label {
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.topbar-meta span,
.hero-tags span,
.auth-highlights span,
.auth-note {
  font-size: 0.9rem;
  line-height: 1.45;
}

.hero-metrics div strong,
.overview-metric strong,
.metric-grid strong,
.mini-grid strong {
  font-size: clamp(1.7rem, 1.9vw, 1.92rem);
  font-weight: 800;
  letter-spacing: -0.045em;
}

.hero-metrics span,
.overview-metric span,
.metric-grid span,
.mini-grid span {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.35;
}

.primary-button,
.secondary-button,
.ghost-button,
.ghost-link {
  min-height: 44px;
  padding: 0 18px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

input,
select,
textarea {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.35;
}

input::placeholder,
textarea::placeholder {
  font-size: 0.95rem;
  font-weight: 500;
}

.section-head {
  margin-bottom: 14px;
}

.topbar-copy {
  gap: 12px;
}

.overview-hero {
  gap: 16px;
}

/* Auth shell refinement */
.auth-shell {
  margin-top: 28px;
}

.auth-panel {
  grid-template-columns: minmax(0, 1.08fr) minmax(420px, 0.92fr);
  gap: 22px;
  padding: 28px;
  border-color: #dce6f0;
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 10%, rgba(47, 109, 246, 0.12) 0, transparent 28%),
    radial-gradient(circle at 68% 0%, rgba(86, 157, 255, 0.08) 0, transparent 18%),
    linear-gradient(180deg, #ffffff 0%, #f5f8fc 100%);
  box-shadow:
    0 28px 70px rgba(15, 23, 42, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.auth-copy {
  gap: 18px;
  padding: 6px 4px 6px 6px;
  align-content: start;
}

.auth-copy h1 {
  max-width: 13ch;
  color: #0f172a;
  font-family: "Sora", "Manrope", "Segoe UI", sans-serif;
  font-size: clamp(1.58rem, 2.05vw, 2.15rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  text-wrap: balance;
}

.auth-copy p {
  max-width: 62ch;
  color: #5b6b80;
  font-size: 0.92rem;
  line-height: 1.58;
}

.auth-highlights {
  margin-top: 6px;
  gap: 12px;
}

.auth-highlights span {
  min-height: 50px;
  align-items: center;
  padding: 0 15px;
  border-color: #dce5ef;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  color: #334155;
  font-size: 0.88rem;
  font-weight: 650;
  line-height: 1.35;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.auth-card {
  gap: 16px;
  padding: 18px;
  border-color: #d8e2ee;
  border-radius: 26px;
  background: linear-gradient(180deg, #fbfdff 0%, #f4f8fc 100%);
  box-shadow:
    0 18px 42px rgba(15, 23, 42, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border-color: #dce6f1;
  border-radius: 16px;
  background: #f2f6fb;
}

.auth-tab {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: #5f7085;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  box-shadow: none;
}

.auth-tab:hover {
  background: rgba(255, 255, 255, 0.72);
  color: #1e293b;
}

.auth-tab.active {
  border-color: #cfe0f5;
  background: #ffffff;
  color: #1f4fd6;
  box-shadow: 0 10px 22px rgba(47, 109, 246, 0.10);
}

.auth-form {
  gap: 14px;
}

.auth-form input,
.auth-form textarea {
  min-height: 50px;
  padding: 0 15px;
  border-color: #d4deea;
  border-radius: 16px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.92rem;
  font-weight: 500;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.88) inset,
    0 8px 20px rgba(15, 23, 42, 0.03);
}

.auth-form textarea {
  min-height: 108px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.auth-form input::placeholder,
.auth-form textarea::placeholder {
  color: #8a9ab0;
  font-weight: 500;
}

.auth-form input:focus,
.auth-form textarea:focus {
  border-color: rgba(47, 109, 246, 0.52);
  box-shadow:
    0 0 0 4px rgba(47, 109, 246, 0.10),
    0 10px 24px rgba(47, 109, 246, 0.08);
}

.auth-form .primary-button {
  min-height: 46px;
  border-radius: 14px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #2f6df6 0%, #1f51d8 100%);
  box-shadow:
    0 10px 22px rgba(47, 109, 246, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.auth-form .primary-button:hover {
  box-shadow:
    0 12px 24px rgba(47, 109, 246, 0.20),
    0 1px 0 rgba(255, 255, 255, 0.22) inset;
}

.auth-note {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  min-height: 0;
  padding: 16px 18px;
  border-color: #dce5ef;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbfe 100%);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
}

.auth-note strong {
  color: #1e293b;
  font-size: 0.9rem;
  line-height: 1.35;
}

.auth-note span {
  color: #64748b;
  font-size: 0.87rem;
  line-height: 1.5;
  word-break: break-word;
}

.form-feedback {
  min-height: 24px;
}

@media (max-width: 1180px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-copy h1 {
    max-width: 12ch;
  }
}

@media (max-width: 720px) {
  .auth-panel {
    padding: 18px;
  }

  .auth-tabs,
  .auth-highlights {
    grid-template-columns: 1fr;
  }

  .auth-copy h1 {
    max-width: none;
    font-size: clamp(1.45rem, 6vw, 1.9rem);
  }

  .auth-form input,
  .auth-form textarea,
  .auth-form .primary-button,
  .auth-tab {
    min-height: 46px;
  }
}

/* Clean CRM pass */
#admin-app .admin-topbar {
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, 340px);
  align-items: start;
  gap: 18px;
  padding: 18px 20px;
}

#admin-app .topbar-copy {
  gap: 8px;
}

#admin-app .topbar-copy h1 {
  max-width: 13ch;
  font-size: clamp(1.58rem, 2.1vw, 1.98rem);
  line-height: 1.02;
}

#admin-app .topbar-copy p {
  max-width: 56ch;
  font-size: 0.95rem;
  line-height: 1.55;
}

#admin-app .topbar-meta {
  gap: 6px;
}

#admin-app .topbar-meta span,
#admin-app .hero-tags span,
#admin-app .stack-list span {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.75rem;
}

#admin-app .topbar-field {
  gap: 6px;
  font-size: 0.84rem;
}

#admin-app .session-summary {
  grid-template-columns: repeat(2, max-content);
  justify-content: start;
}

#admin-app .topbar-buttons {
  gap: 10px;
}

#admin-app .primary-button,
#admin-app .secondary-button,
#admin-app .ghost-button,
#admin-app .ghost-link {
  min-height: 42px;
  border-radius: 12px;
}

#admin-app .overview-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(360px, 0.82fr);
  grid-template-areas:
    "hero side"
    "chart side";
  gap: 16px;
  align-items: start;
}

#admin-app .overview-hero,
#admin-app .overview-graph-card,
#admin-app .dashboard-card,
#admin-app .list-card,
#admin-app .detail-card,
#admin-app .chart-card,
#admin-app .breakdown-card,
#admin-app .info-block,
#admin-app .config-card,
#admin-app .catalog-row,
#admin-app .pricebook-row {
  border-radius: 18px;
  box-shadow:
    0 14px 30px rgba(15, 23, 42, 0.08),
    0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

#admin-app .overview-hero,
#admin-app .dashboard-card,
#admin-app .list-card,
#admin-app .detail-card,
#admin-app .config-card {
  padding: 18px;
}

#admin-app .overview-hero {
  grid-area: hero;
  min-height: 216px;
  gap: 12px;
}

#admin-app .overview-main-chart {
  grid-area: chart;
  min-height: 0;
}

#admin-app .overview-side-panel {
  grid-area: side;
  gap: 16px;
}

#admin-app .overview-hero::after {
  display: none;
}

#admin-app .overview-hero h2 {
  max-width: 11ch;
  font-size: clamp(1.42rem, 2.05vw, 1.9rem);
}

#admin-app .hero-metrics,
#admin-app .overview-metrics,
#admin-app .dashboard-metrics,
#admin-app .metric-grid,
#admin-app .mini-grid,
#admin-app .breakdown-grid {
  gap: 12px;
}

#admin-app .hero-metrics div,
#admin-app .overview-metric,
#admin-app .metric-grid div,
#admin-app .mini-grid div {
  padding: 14px 16px;
  border-radius: 16px;
}

#admin-app .hero-metrics strong,
#admin-app .overview-metric strong,
#admin-app .metric-grid strong,
#admin-app .mini-grid strong {
  font-size: 2rem;
}

#admin-app .hero-metrics span,
#admin-app .overview-metric span,
#admin-app .metric-grid span,
#admin-app .mini-grid span {
  margin-top: 6px;
  font-size: 0.84rem;
  line-height: 1.35;
}

#admin-app .overview-metric {
  min-height: 102px;
}

#admin-app .overview-graph-card,
#admin-app .chart-card,
#admin-app .breakdown-card,
#admin-app .info-block {
  padding: 16px;
}

#admin-app .section-head,
#admin-app .compact-head {
  margin-bottom: 14px;
}

#admin-app .section-head h2,
#admin-app .compact-head h2,
#admin-app .chart-card-head h3 {
  margin-top: 6px;
  font-size: 1.18rem;
  line-height: 1.06;
}

#admin-app .overview-snapshot-legend {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

#admin-app .overview-snapshot-legend span {
  padding: 10px 12px;
}

#admin-app .dashboard-layout {
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, 0.94fr);
  gap: 16px;
}

#admin-app .metric-grid,
#admin-app .mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

#admin-app .chart-track,
#admin-app .service-bar-track {
  height: 10px;
}

#admin-app .breakdown-card h3,
#admin-app .info-block h3 {
  margin-bottom: 12px;
  font-size: 0.98rem;
}

#admin-app .lead-desk-shell {
  grid-template-columns: minmax(340px, 372px) minmax(0, 1fr);
  gap: 16px;
}

#admin-app .list-card,
#admin-app .detail-card {
  display: grid;
  gap: 16px;
  align-content: start;
}

#admin-app .toolbar {
  gap: 10px;
  margin-bottom: 14px;
}

#admin-app .lead-toolbar {
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 0;
  padding: 14px;
  border: 1px solid #dde6f0;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

#admin-app .lead-toolbar-search,
#admin-app .lead-toolbar-actions {
  display: grid;
}

#admin-app .lead-toolbar-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#admin-app .lead-toolbar-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#admin-app #search-input {
  grid-column: auto;
  min-width: 0;
}

#admin-app .lead-list {
  max-height: calc(100vh - 392px);
  padding-right: 6px;
}

#admin-app .lead-row,
#admin-app .catalog-row {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 14px;
}

#admin-app .lead-row {
  border-color: #dde6f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

#admin-app .lead-row.active,
#admin-app .lead-row:hover {
  border-color: #c6d7ea;
  background: linear-gradient(180deg, #ffffff 0%, #f4f8fd 100%);
  box-shadow:
    0 14px 28px rgba(15, 23, 42, 0.07),
    0 0 0 1px rgba(47, 109, 246, 0.08);
}

#admin-app .lead-row-head,
#admin-app .lead-row-body,
#admin-app .lead-row-foot {
  margin-bottom: 0;
  align-items: center;
}

#admin-app .lead-row-identity,
#admin-app .lead-row-score {
  display: grid;
  gap: 4px;
}

#admin-app .lead-row-identity strong {
  font-size: 1.02rem;
  line-height: 1.2;
}

#admin-app .lead-row-identity span,
#admin-app .lead-row-city,
#admin-app .lead-row-status,
#admin-app .lead-row-foot span {
  color: #64748b;
  font-size: 0.84rem;
  line-height: 1.4;
}

#admin-app .lead-row-score {
  justify-items: end;
}

#admin-app .lead-row-score strong {
  color: #334155;
  font-size: 0.9rem;
  line-height: 1;
}

#admin-app .lead-row-status {
  font-weight: 700;
}

#admin-app .lead-row-summary {
  margin-bottom: 0;
  color: #405368;
  font-size: 0.9rem;
  line-height: 1.55;
}

#admin-app .lead-row-meta,
#admin-app .lead-row-flags {
  margin-bottom: 0;
}

#admin-app .lead-row-foot {
  padding-top: 10px;
  border-top: 1px solid #e7eef5;
}

#admin-app .meta-pill,
#admin-app .mini-flag {
  min-height: 29px;
  font-size: 0.72rem;
}

#admin-app .detail-content {
  gap: 16px;
}

#admin-app .lead-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 12px;
}

#admin-app .summary-card {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid #dde6f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

#admin-app .summary-card span {
  color: #7b8ba1;
  font-family: var(--admin-font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#admin-app .summary-card strong {
  color: #0f172a;
  font-size: 0.96rem;
  line-height: 1.45;
  word-break: break-word;
}

#admin-app #lead-data {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#admin-app #lead-data div {
  padding: 12px 14px;
  border: 1px solid #e2eaf2;
  border-radius: 14px;
  background: #fafcff;
}

#admin-app .score-summary {
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

#admin-app .score-total {
  font-size: clamp(2.6rem, 3vw, 3.2rem);
}

#admin-app .score-reason {
  min-height: 0;
  padding: 14px 16px;
  border-color: #dde6f0;
  background: linear-gradient(180deg, #fbfdff 0%, #f5f9fd 100%);
}

#admin-app .score-parts {
  gap: 10px;
}

#admin-app .score-parts span,
#admin-app .analysis-summary,
#admin-app .analysis-note-stack,
#admin-app .handoff-stack > div {
  border-color: #dde6f0;
  background: linear-gradient(180deg, #fbfdff 0%, #f7faff 100%);
}

#admin-app .detail-actions-panel {
  gap: 14px;
}

#admin-app .detail-actions-panel h3 {
  margin-bottom: 0;
}

#admin-app .action-row {
  grid-template-columns: minmax(180px, 220px) auto minmax(220px, 1fr) auto;
  gap: 12px;
}

#admin-app .estimate-box {
  gap: 14px;
}

#admin-app .estimate-range {
  color: #0f172a;
  font-size: clamp(1.9rem, 2.2vw, 2.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  font-weight: 800;
}

#admin-app .estimate-lines {
  display: grid;
  gap: 10px;
}

#admin-app .estimate-line {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid #dde6f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fbfdff 0%, #f8fbff 100%);
}

#admin-app .estimate-line span {
  color: #ff7d31;
  font-weight: 700;
}

#admin-app .estimate-line p {
  margin: 0;
  color: #4d6278;
}

#admin-app .message-list {
  max-height: 540px;
  overflow: auto;
  padding-right: 6px;
}

#admin-app .message {
  max-width: 86%;
  padding: 14px 16px;
  border-color: #dde6f0;
  border-radius: 18px;
  background: #ffffff;
  box-shadow:
    0 8px 20px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

#admin-app .message.assistant {
  justify-self: start;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbfe 100%);
}

#admin-app .message.user {
  justify-self: end;
  background: linear-gradient(180deg, #eef4ff 0%, #e7eef9 100%);
}

#admin-app .message span {
  margin-bottom: 6px;
  color: #7b8ba1;
}

#admin-app .message p {
  margin: 0;
  color: #334155;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  #admin-app .admin-topbar,
  #admin-app .overview-grid,
  #admin-app .dashboard-layout,
  #admin-app .lead-desk-shell,
  #admin-app .channels-grid,
  #admin-app .config-grid {
    grid-template-columns: 1fr;
  }

  #admin-app .overview-grid {
    grid-template-areas:
      "hero"
      "chart"
      "side";
  }

  #admin-app .metric-grid,
  #admin-app .mini-grid,
  #admin-app .overview-metrics,
  #admin-app .breakdown-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #admin-app .lead-toolbar-filters {
    grid-template-columns: 1fr 1fr;
  }

  #admin-app .action-row {
    grid-template-columns: 1fr 1fr;
  }

  #admin-app #assign-input {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  #admin-app .admin-topbar,
  #admin-app .overview-hero,
  #admin-app .dashboard-card,
  #admin-app .list-card,
  #admin-app .detail-card,
  #admin-app .config-card {
    padding: 16px;
  }

  #admin-app .topbar-buttons,
  #admin-app .metric-grid,
  #admin-app .mini-grid,
  #admin-app .overview-metrics,
  #admin-app .breakdown-grid,
  #admin-app .overview-snapshot-legend,
  #admin-app .lead-toolbar-filters,
  #admin-app .lead-toolbar-actions,
  #admin-app .lead-summary-strip,
  #admin-app #lead-data,
  #admin-app .score-summary,
  #admin-app .score-parts {
    grid-template-columns: 1fr;
  }

  #admin-app .topbar-copy h1 {
    max-width: none;
  }

  #admin-app .message {
    max-width: 100%;
  }
}

/* Channels and contact export refinement */
#admin-app .lead-toolbar-actions {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr) minmax(0, 0.88fr);
}

#admin-app .lead-toolbar-actions .ghost-button,
#admin-app .lead-toolbar-actions .secondary-button {
  white-space: nowrap;
  font-size: 0.88rem;
  padding-inline: 12px;
}

#admin-app .channels-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 20px;
}

#admin-app .channels-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

#admin-app .channels-section-head p {
  margin: 0;
  justify-self: start;
  max-width: 58ch;
  font-size: 0.92rem;
}

#admin-app[data-active-admin-tab="channels"] .admin-topbar {
  grid-template-columns: minmax(0, 1.34fr) minmax(300px, 380px);
  align-items: center;
  padding: 20px;
}

#admin-app[data-active-admin-tab="channels"] .topbar-copy {
  gap: 8px;
}

#admin-app[data-active-admin-tab="channels"] .topbar-copy h1 {
  max-width: 13ch;
  font-size: clamp(1.62rem, 1.95vw, 1.92rem);
}

#admin-app[data-active-admin-tab="channels"] .topbar-copy p {
  max-width: 56ch;
  font-size: 0.92rem;
}

#admin-app[data-active-admin-tab="channels"] .topbar-meta span {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.72rem;
}

#admin-app .channels-form,
#admin-app .channels-copy-card,
#admin-app .channels-form-section,
#admin-app .channels-form-section-head,
#admin-app .channels-summary-strip,
#admin-app .channels-summary-card,
#admin-app .channels-live-card,
#admin-app .channels-config-card {
  display: grid;
  gap: 14px;
}

#admin-app .channels-config-card,
#admin-app .channels-live-card {
  padding: 20px;
}

#admin-app .channels-copy-card,
#admin-app .channels-form-section,
#admin-app .channels-summary-card,
#admin-app .channel-status-card,
#admin-app .pairing-card,
#admin-app .meta-tool-card,
#admin-app .meta-reply-preview {
  border: 1px solid #dde6f0;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
  box-shadow:
    0 12px 24px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

#admin-app .channels-copy-card,
#admin-app .channels-form-section,
#admin-app .channel-status-card,
#admin-app .meta-tool-card,
#admin-app .meta-reply-preview {
  padding: 16px;
}

#admin-app .channels-copy-card {
  gap: 10px;
  padding: 18px;
  background:
    radial-gradient(circle at top right, rgba(47, 109, 246, 0.08), transparent 42%),
    linear-gradient(180deg, #fbfdff 0%, #f5f8fc 100%);
}

#admin-app .channels-copy-card .ops-intro,
#admin-app .channels-mode-note {
  margin: 0;
  color: #64748b;
  line-height: 1.58;
}

#admin-app .channels-form-section-head h3,
#admin-app .pairing-copy h3,
#admin-app .meta-tool-card h4 {
  margin: 0;
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.15;
}

#admin-app .channels-form-grid,
#admin-app .channels-toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#admin-app .channels-form-grid textarea {
  min-height: 102px;
}

#admin-app .channels-toggle-grid .toggle-field {
  min-height: 60px;
  padding: 14px 16px;
  border-color: #dde6f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.03);
}

#admin-app .channels-summary-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#admin-app .channels-summary-card {
  min-height: 92px;
  padding: 14px 16px;
  border: 1px solid #dde6f0;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

#admin-app .channels-summary-card span {
  color: #7b8ba1;
  font-family: var(--admin-font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#admin-app .channels-summary-card strong {
  color: #0f172a;
  font-size: 0.96rem;
  line-height: 1.3;
  word-break: break-word;
}

#admin-app .channels-summary-card p,
#admin-app .channel-status-card p,
#admin-app .pairing-copy p,
#admin-app .pairing-meta span,
#admin-app .meta-tool-card p,
#admin-app .meta-reply-preview p {
  margin: 0;
  color: #64748b;
  line-height: 1.6;
}

#admin-app .channel-status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

#admin-app .channel-status-card {
  gap: 8px;
  min-height: 104px;
  background: #ffffff;
}

#admin-app .channel-status-card strong,
#admin-app .pairing-meta strong {
  color: #0f172a;
  font-size: 1rem;
  line-height: 1.2;
}

#admin-app .pairing-card {
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  background:
    radial-gradient(circle at top right, rgba(47, 109, 246, 0.08), transparent 40%),
    linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
}

#admin-app .pairing-shell {
  grid-template-columns: minmax(168px, 196px) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

#admin-app .qr-demo-card {
  min-height: 212px;
  border-color: #dbe5f0;
  border-radius: 22px;
  background:
    radial-gradient(circle at 20% 18%, rgba(47, 109, 246, 0.12) 0, transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f5f9fd 100%);
}

#admin-app .qr-demo-empty {
  justify-items: start;
  align-content: center;
  min-height: 188px;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.74);
}

#admin-app .channels-actions-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#admin-app .channels-actions-row .primary-button,
#admin-app .channels-actions-row .secondary-button,
#admin-app .channels-actions-row .ghost-button {
  width: 100%;
  min-height: 44px;
  font-size: 0.9rem;
}

#admin-app .meta-checklist {
  gap: 10px;
}

#admin-app .meta-check-item {
  border-color: #dde6f0;
  border-radius: 16px;
  background: #ffffff;
}

#admin-app .meta-tools-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

#admin-app .meta-tool-card,
#admin-app .meta-reply-preview {
  gap: 12px;
}

#admin-app .meta-reply-preview {
  background:
    radial-gradient(circle at top right, rgba(47, 109, 246, 0.08), transparent 42%),
    linear-gradient(180deg, #fbfdff 0%, #f6f9fd 100%);
}

@media (max-width: 1180px) {
  #admin-app .channels-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #admin-app[data-active-admin-tab="channels"] .admin-topbar {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  #admin-app .lead-toolbar-actions,
  #admin-app .channels-form-grid,
  #admin-app .channels-toggle-grid,
  #admin-app .channels-summary-strip,
  #admin-app .channel-status-grid,
  #admin-app .channels-actions-row {
    grid-template-columns: 1fr;
  }

  #admin-app .pairing-shell {
    grid-template-columns: 1fr;
  }
}

/* Absolute final override block */
#admin-app .lead-toolbar { gap: 14px !important; padding: 14px !important; border: 1px solid #d8e3ef !important; border-radius: 16px !important; background: #fbfdff !important; }
#admin-app .lead-toolbar-actions,
#admin-app .button-row.inline-actions { display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 10px !important; }
#admin-app .action-row { grid-template-columns: 1.05fr 0.85fr 1.2fr 0.9fr !important; gap: 10px !important; }
#admin-app .meta-check-state.ok { border: 1px solid #9ed7b5 !important; background: #ecf9f0 !important; color: #1f7a45 !important; }
#admin-app .meta-check-state.todo { border: 1px solid #f3c48f !important; background: #fff5e9 !important; color: #9a5815 !important; }
#admin-app .pricebook-import-panel .button-row { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
#admin-app .pricebook-file-input { width: 100% !important; min-height: 44px !important; padding: 10px 12px !important; border: 1px solid #d8e3ef !important; border-radius: 14px !important; background: #fff !important; }

@media (max-width: 1180px) {
  #admin-app .lead-toolbar-actions,
  #admin-app .button-row.inline-actions,
  #admin-app .pricebook-import-panel .button-row,
  #admin-app .action-row {
    grid-template-columns: 1fr !important;
  }
}

/* Z-Final hard overrides: keep last */
#admin-app {
  padding-bottom: max(84px, env(safe-area-inset-bottom)) !important;
}

#admin-app .configuration-shell,
#admin-app .lead-desk-shell,
#admin-app .workspace-grid,
#admin-app .overview-grid {
  padding-bottom: 18px !important;
}

#admin-app .channels-config-card,
#admin-app .channels-live-card,
#admin-app .config-card,
#admin-app .detail-card {
  padding-bottom: 22px !important;
}

#admin-app #channels-form > .button-row,
#admin-app .pricebook-import-panel > .button-row,
#admin-app .channels-actions-row,
#admin-app .button-row.inline-actions {
  margin-top: 4px !important;
  margin-bottom: 8px !important;
}

#admin-app .lead-toolbar-actions {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)) !important;
}

#admin-app .pricebook-file-input {
  overflow: hidden !important;
  line-height: 1.2 !important;
}

#admin-app .pricebook-file-input::file-selector-button {
  margin-right: 12px;
  border: 1px solid #d0dbea;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #f3f7fd 100%);
  color: #1f2d3d;
  font-weight: 600;
  padding: 8px 12px;
  cursor: pointer;
}

/* Z-Final-2: Overview redesign + border consistency */
#admin-app .overview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr) !important;
  gap: 16px !important;
}

#admin-app .overview-main-chart {
  grid-column: 1 / -1 !important;
  min-height: 470px !important;
}

#admin-app .overview-main-chart .overview-snapshot-chart {
  min-height: 332px !important;
  padding: 12px 14px !important;
  border: 1px solid #dbe5f0 !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, #fcfeff 0%, #f5f8fd 100%) !important;
}

#admin-app .overview-side-panel {
  display: grid !important;
  gap: 14px !important;
}

#admin-app .overview-live-breakdown {
  display: grid;
  gap: 10px;
}

#admin-app .overview-live-row {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid #dce6f2;
  border-radius: 12px;
  background: #ffffff;
}

#admin-app .overview-live-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

#admin-app .overview-live-head strong {
  color: #0f172a;
  font-size: 0.93rem;
}

#admin-app .overview-live-head span {
  color: #64748b;
  font-size: 0.84rem;
  font-weight: 600;
}

#admin-app .overview-live-track {
  height: 10px;
  border-radius: 999px;
  background: #edf3fa;
  overflow: hidden;
}

#admin-app .overview-live-fill {
  display: block;
  height: 100%;
  width: max(2%, var(--bar-size));
  border-radius: inherit;
  background: linear-gradient(90deg, #7a5cff 0%, #5b8dff 100%);
}

#admin-app .overview-live-fill.good {
  background: linear-gradient(90deg, #2fbf71 0%, #1f9e5c 100%);
}

#admin-app .overview-live-fill.warm {
  background: linear-gradient(90deg, #ff8f3a 0%, #ff6d1f 100%);
}

#admin-app .overview-live-fill.cold {
  background: linear-gradient(90deg, #9aaac0 0%, #7f8ea5 100%);
}

#admin-app .overview-drop-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

#admin-app .overview-drop-legend span {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe5f0;
  border-radius: 999px;
  color: #53647a;
  font-size: 0.78rem;
}

#admin-app .overview-drop-legend strong {
  color: #1f2d3f;
  font-size: 0.8rem;
}

#admin-app .overview-guides text {
  fill: #8a9ab0;
  font-size: 10px;
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

#admin-app .overview-point .point-value {
  fill: #24344a;
  font-size: 10px;
  font-weight: 700;
  font-family: "IBM Plex Mono", "Consolas", monospace;
}

#admin-app .overview-hero,
#admin-app .overview-metric,
#admin-app .hero-metrics > div,
#admin-app .hero-tags span,
#admin-app .meta-pill,
#admin-app .overview-live-row,
#admin-app .overview-main-chart,
#admin-app .overview-side-panel > .overview-graph-card {
  border: 1px solid #dbe5f0 !important;
}

#admin-app .hero-tags span,
#admin-app .meta-pill {
  border-radius: 999px !important;
}

@media (max-width: 1180px) {
  #admin-app .overview-main-chart {
    min-height: 420px !important;
  }

  #admin-app .overview-drop-legend {
    grid-template-columns: 1fr;
  }
}

/* Z-Final-3: prevent Overview overlap between side panel and chart */
#admin-app .overview-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.78fr) !important;
  grid-template-areas:
    "hero side"
    "chart chart" !important;
  align-items: start !important;
}

#admin-app .overview-hero {
  grid-area: hero !important;
}

#admin-app .overview-side-panel {
  grid-area: side !important;
  align-content: start !important;
  position: relative;
  z-index: 2;
}

#admin-app .overview-main-chart {
  grid-area: chart !important;
  grid-column: auto !important;
  grid-row: auto !important;
  position: relative;
  z-index: 1;
}

@media (max-width: 1180px) {
  #admin-app .overview-grid {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "hero"
      "side"
      "chart" !important;
  }
}

/* Z-Final-4: Overview strict two-column flow (no vertical gaps) */
#admin-app .overview-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.76fr) !important;
  gap: 16px !important;
  align-items: start !important;
  grid-template-areas: none !important;
}

#admin-app .overview-main-column {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

#admin-app .overview-main-column .overview-hero,
#admin-app .overview-main-column .overview-main-chart {
  margin: 0 !important;
}

#admin-app .overview-hero {
  grid-area: auto !important;
}

#admin-app .overview-main-chart {
  grid-area: auto !important;
  grid-column: auto !important;
  grid-row: auto !important;
}

#admin-app .overview-side-panel {
  grid-area: auto !important;
  align-content: start !important;
  min-width: 0;
}

@media (max-width: 1180px) {
  #admin-app .overview-grid {
    grid-template-columns: 1fr !important;
  }

  #admin-app .overview-main-column {
    order: 1;
  }

  #admin-app .overview-side-panel {
    order: 2;
  }
}

/* Z-Mobile-Hard: all admin tabs */
@media (max-width: 900px) {
  html, body {
    overflow-x: hidden !important;
  }

  #admin-app,
  #admin-app .admin-panel,
  #admin-app .configuration-shell,
  #admin-app .workspace-grid,
  #admin-app .overview-grid,
  #admin-app .lead-desk-shell,
  #admin-app .config-grid,
  #admin-app .catalog-grid,
  #admin-app .channels-grid,
  #admin-app .pricebook-layout,
  #admin-app .dashboard-layout,
  #admin-app .dashboard-metrics,
  #admin-app .breakdown-grid,
  #admin-app .detail-grid,
  #admin-app .action-row,
  #admin-app .channels-form-grid,
  #admin-app .channels-toggle-grid,
  #admin-app .channel-status-grid,
  #admin-app .channels-summary-strip,
  #admin-app .meta-tools-grid,
  #admin-app .widget-preview-card,
  #admin-app .snippet-card,
  #admin-app .topbar-copy,
  #admin-app .topbar-actions,
  #admin-app .topbar-buttons,
  #admin-app .toolbar,
  #admin-app .button-row,
  #admin-app .lead-toolbar,
  #admin-app .lead-toolbar-filters,
  #admin-app .lead-toolbar-actions,
  #admin-app .overview-main-column,
  #admin-app .overview-side-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    grid-template-columns: 1fr !important;
    grid-template-areas: none !important;
  }

  #admin-app .admin-topbar {
    grid-template-columns: 1fr !important;
    align-items: start !important;
    padding: 16px !important;
  }

  #admin-app .topbar-copy {
    gap: 8px !important;
  }

  #admin-app .topbar-copy h1 {
    max-width: 22ch !important;
    font-size: clamp(1.48rem, 7vw, 1.9rem) !important;
    line-height: 1.06 !important;
  }

  #admin-app .topbar-description,
  #admin-app .topbar-meta {
    display: none !important;
  }

  #admin-app .topbar-actions,
  #admin-app .topbar-buttons {
    justify-items: stretch !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  #admin-app .topbar-buttons > * {
    width: 100% !important;
    min-width: 0 !important;
  }

  #admin-app .config-card,
  #admin-app .list-card,
  #admin-app .detail-card,
  #admin-app .dashboard-card,
  #admin-app .channels-live-card,
  #admin-app .channels-config-card,
  #admin-app .pricebook-import-panel,
  #admin-app .pricebook-list-shell,
  #admin-app .overview-main-chart,
  #admin-app .overview-hero,
  #admin-app .overview-side-panel > .overview-graph-card {
    padding: 14px !important;
    margin: 0 !important;
  }

  #admin-app .overview-main-chart,
  #admin-app .overview-main-chart .overview-snapshot-chart {
    min-height: 300px !important;
  }

  #admin-app .overview-drop-legend,
  #admin-app .hero-metrics,
  #admin-app .overview-metrics,
  #admin-app .catalog-topline,
  #admin-app .catalog-pricing-grid,
  #admin-app .catalog-dual-grid,
  #admin-app .channels-actions-row,
  #admin-app .button-row.inline-actions,
  #admin-app .pricebook-import-panel .button-row {
    grid-template-columns: 1fr !important;
  }

  #admin-app .lead-list,
  #admin-app .catalog-list,
  #admin-app .pricebook-list {
    max-height: none !important;
    overflow: visible !important;
  }

  #admin-app input,
  #admin-app select,
  #admin-app textarea,
  #admin-app button,
  #admin-app .ghost-link,
  #admin-app .primary-button,
  #admin-app .secondary-button,
  #admin-app .ghost-button,
  #admin-app .danger-button {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  #admin-app .meta-check-item,
  #admin-app .overview-live-row,
  #admin-app .catalog-row,
  #admin-app .pricebook-row {
    min-width: 0 !important;
  }
}

@media (max-width: 520px) {
  .admin-brandbar-inner,
  .admin-shell,
  .auth-shell {
    width: calc(100% - 16px) !important;
  }

  #admin-app {
    padding-bottom: 88px !important;
  }

  #admin-app .section-head h2,
  #admin-app .section-head h3 {
    font-size: clamp(1.1rem, 5.2vw, 1.34rem) !important;
  }
}

/* Operator Conversation Controls */
#admin-app .conversation-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

#admin-app .conversation-toolbar .status-pill.mode-bot {
  background: rgba(32, 104, 255, 0.12);
  border-color: rgba(32, 104, 255, 0.3);
}

#admin-app .conversation-toolbar .status-pill.mode-human {
  background: rgba(255, 136, 0, 0.12);
  border-color: rgba(255, 136, 0, 0.35);
}

#admin-app .conversation-toolbar .status-pill.mode-hybrid {
  background: rgba(28, 170, 112, 0.12);
  border-color: rgba(28, 170, 112, 0.35);
}

#admin-app .message-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

#admin-app .message-head-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

#admin-app .message-admin-actions,
#admin-app .message-attachment-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

#admin-app .message-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--admin-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted-soft);
  text-decoration: none;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

#admin-app .message-action-button.subtle {
  min-height: 22px;
  height: 22px;
}

#admin-app .message-action-button.danger {
  border-color: rgba(248, 113, 113, 0.34);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.2);
}

#admin-app .message-state-pill {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  border: 1px solid var(--admin-line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--admin-muted-soft);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#admin-app .message-state-pill.state-edited {
  border-color: rgba(59, 130, 246, 0.34);
  color: #bfdbfe;
  background: rgba(29, 78, 216, 0.18);
}

#admin-app .message-state-pill.state-deleted {
  border-color: rgba(248, 113, 113, 0.34);
  color: #fecaca;
  background: rgba(127, 29, 29, 0.16);
}

#admin-app .message.is-deleted {
  opacity: 0.84;
}

#admin-app .message.is-deleted .message-body {
  color: var(--admin-muted-soft);
  font-style: italic;
}

#admin-app .thread-modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(2, 6, 23, 0.66);
  backdrop-filter: blur(2px);
  padding: 16px;
}

#admin-app .thread-modal.hidden {
  display: none;
}

#admin-app .thread-modal-card {
  width: min(560px, 100%);
  border-radius: 14px;
  border: 1px solid var(--admin-line);
  background: rgba(8, 14, 28, 0.96);
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.5);
  padding: 14px;
  display: grid;
  gap: 10px;
}

#admin-app .thread-modal-card h4 {
  margin: 0;
}

#admin-app .thread-modal-card textarea {
  min-height: 130px;
  resize: vertical;
}

#admin-app .thread-modal-actions {
  display: inline-flex;
  justify-content: flex-end;
  gap: 8px;
}

#admin-app .thread-media-card {
  width: min(900px, 100%);
  max-height: min(90vh, 760px);
}

#admin-app .thread-modal-close {
  justify-self: flex-end;
}

#admin-app .thread-media-body {
  display: grid;
  gap: 8px;
}

#admin-app .thread-media-body img {
  width: 100%;
  max-height: min(72vh, 620px);
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--admin-line);
  background: rgba(6, 10, 20, 0.9);
}

#admin-app .thread-media-caption {
  margin: 0;
  color: var(--admin-muted-soft);
  font-size: 0.82rem;
}

#admin-app .message-attachment-actions {
  justify-content: flex-start;
}

#admin-app .operator-reply-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

#admin-app .operator-composer-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#admin-app .operator-tool-button {
  min-height: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

#admin-app #operator-audio-record-button.is-recording {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.18);
  color: #ffe2e2;
}

#admin-app .operator-emoji-panel {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(12, 20, 36, 0.92);
}

#admin-app .operator-emoji-panel button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--admin-line);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
}

#admin-app .operator-actual-emoji-panel {
  max-width: 280px;
}

#admin-app .operator-actual-emoji-panel button {
  font-size: 1.15rem;
  line-height: 1;
}

#admin-app .operator-text-style-panel {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(12, 20, 36, 0.92);
}

#admin-app .operator-text-style-title {
  color: var(--admin-muted-soft);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

#admin-app .operator-text-style-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#admin-app .operator-text-style-group button {
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--admin-line);
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
  padding: 0 8px;
  font-size: 0.72rem;
  font-weight: 600;
}

#admin-app .operator-text-style-group button.active {
  border-color: rgba(59, 130, 246, 0.45);
  background: rgba(59, 130, 246, 0.18);
  color: #dbeafe;
}

#admin-app .operator-attachment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#admin-app .operator-upload-progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border: 1px solid var(--admin-line);
  background: rgba(15, 23, 42, 0.78);
  overflow: hidden;
}

#admin-app .operator-upload-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6 0%, #22d3ee 100%);
  box-shadow: 0 0 14px rgba(59, 130, 246, 0.45);
  transition: width 180ms ease;
}

#admin-app .operator-attachment-item {
  position: relative;
  width: min(180px, 100%);
  padding: 6px;
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: rgba(11, 19, 35, 0.82);
}

#admin-app .operator-attachment-media {
  display: grid;
  gap: 4px;
}

#admin-app .operator-attachment-media img {
  width: 100%;
  max-height: 120px;
  border-radius: 8px;
  object-fit: cover;
}

#admin-app .operator-attachment-media audio {
  width: 100%;
}

#admin-app .operator-attachment-label {
  font-size: 0.72rem;
  color: var(--admin-muted-soft);
  line-height: 1.3;
}

#admin-app .operator-attachment-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid var(--admin-line);
  background: rgba(15, 23, 42, 0.92);
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

#admin-app .operator-composer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

#admin-app .operator-reply-form textarea {
  width: 100%;
  min-height: 40px;
  max-height: 96px;
  resize: vertical;
}

#admin-app #operator-reply-input.composer-size-sm {
  font-size: 0.92rem;
  line-height: 1.45;
}

#admin-app #operator-reply-input.composer-size-md {
  font-size: 1rem;
  line-height: 1.5;
}

#admin-app #operator-reply-input.composer-size-lg {
  font-size: 1.08rem;
  line-height: 1.58;
}

#admin-app #operator-reply-input.composer-font-default {
  font-family: "Manrope", "Geomanist", "Segoe UI", sans-serif;
}

#admin-app #operator-reply-input.composer-font-mono {
  font-family: "IBM Plex Mono", monospace;
}

#admin-app #operator-reply-input.composer-font-sora {
  font-family: "Sora", "Manrope", "Segoe UI", sans-serif;
}

#admin-app .operator-reply-form #operator-reply-send {
  min-height: 40px;
  height: 40px;
  border-radius: 10px;
  padding: 0 14px;
  white-space: nowrap;
}

#admin-app .message.operator {
  border-left-color: rgba(255, 136, 0, 0.62);
  background: linear-gradient(135deg, rgba(255, 136, 0, 0.12), rgba(255, 136, 0, 0.04));
}

@media (max-width: 900px) {
  #admin-app .conversation-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* P0 Lead Desk Visual Cleanup */
#admin-app #lead-desk.lead-desk-shell {
  grid-template-columns: 340px minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: start;
}

#admin-app #lead-desk .detail-card {
  padding: 18px !important;
  border-radius: 18px !important;
}

#admin-app #lead-desk .detail-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px !important;
}

#admin-app #lead-desk .info-block {
  padding: 14px !important;
  border-radius: 14px !important;
}

#admin-app #lead-desk .info-block h3 {
  margin-bottom: 10px !important;
  font-size: 1.06rem !important;
}

#admin-app #lead-desk .lead-summary-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

#admin-app #lead-desk .summary-card {
  padding: 10px 12px !important;
  min-height: 0 !important;
}

#admin-app #lead-desk .score-box {
  gap: 10px !important;
}

#admin-app #lead-desk .score-box ul {
  margin: 8px 0 0 !important;
  padding-left: 18px !important;
}

#admin-app #lead-desk .action-row,
#admin-app #lead-desk .button-row.inline-actions {
  gap: 8px !important;
}

#admin-app #lead-desk #message-list.message-list {
  max-height: 280px !important;
  padding-right: 6px !important;
}

#admin-app #lead-desk .transcript-panel {
  position: relative;
}

#admin-app #lead-desk .conversation-toolbar {
  margin-bottom: 10px !important;
}

@media (max-width: 1280px) {
  #admin-app #lead-desk.lead-desk-shell {
    grid-template-columns: 1fr !important;
  }

  #admin-app #lead-desk .lead-summary-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 900px) {
  #admin-app #lead-desk .detail-grid {
    grid-template-columns: 1fr !important;
  }

  #admin-app #lead-desk .lead-summary-strip {
    grid-template-columns: 1fr !important;
  }
}

/* Site 3 conversation header cleanup + moderation UI */
body.page-admin.site-3 #admin-app #lead-desk .transcript-panel > h3,
body.page-admin.site-3 #admin-app #lead-desk .thread-tabs {
  display: none !important;
}

body.page-admin.site-3 #admin-app #lead-desk .conversation-toolbar {
  justify-content: flex-start !important;
  margin: 0 0 10px !important;
}

body.page-admin.site-3 #admin-app #lead-desk #conversation-mode-pill.status-pill {
  min-height: 22px !important;
  height: 22px !important;
  padding: 0 8px !important;
  border-radius: 999px !important;
  font-size: 0.64rem !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

body.page-admin.site-3 #admin-app #lead-desk #lead-toggle-mode-button {
  width: auto !important;
  min-width: 0 !important;
  min-height: 24px !important;
  height: 24px !important;
  padding: 0 10px !important;
  border-radius: 999px !important;
  font-size: 0.68rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.03em !important;
  line-height: 1 !important;
  flex: 0 0 auto !important;
}

body.page-admin.site-3 #admin-app #lead-desk #lead-delete-chat-mini-button {
  width: 24px !important;
  min-width: 24px !important;
  height: 24px !important;
  min-height: 24px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
}

body.page-admin.site-3 #admin-app #lead-desk .message-head {
  align-items: flex-start !important;
}

body.page-admin.site-3 #admin-app #lead-desk .message-head-meta {
  gap: 6px !important;
}

body.page-admin.site-3 #admin-app #lead-desk .message-action-button {
  border-color: rgba(106, 135, 173, 0.3) !important;
  background: rgba(14, 22, 40, 0.86) !important;
  color: #bfd2ef !important;
}

body.page-admin.site-3 #admin-app #lead-desk .message-action-button.danger {
  border-color: rgba(248, 113, 113, 0.34) !important;
  background: rgba(127, 29, 29, 0.24) !important;
  color: #fecaca !important;
}

body.page-admin.site-3 #admin-app #lead-desk .message-attachment-actions {
  margin-top: 2px !important;
}

body.page-admin.site-3 #admin-app #lead-desk .thread-modal {
  z-index: 120 !important;
  background: rgba(2, 6, 23, 0.72) !important;
}

body.page-admin.site-3 #admin-app #lead-desk .thread-modal-card {
  border: 1px solid rgba(106, 135, 173, 0.32) !important;
  background: linear-gradient(180deg, rgba(8, 14, 28, 0.96) 0%, rgba(6, 10, 20, 0.98) 100%) !important;
}

/* Final: icon-only channel badges + remove bright white borders */
body.page-admin #admin-app .channel-badge[data-channel-tooltip],
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip] {
  position: relative;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  min-width: 20px !important;
  height: 20px !important;
  min-height: 20px !important;
  padding: 0 !important;
  border-radius: 999px !important;
  font-size: 0 !important;
  line-height: 0 !important;
  overflow: visible;
}

body.page-admin #admin-app .channel-badge[data-channel-tooltip]::before,
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip]::before {
  content: "" !important;
  width: 14px !important;
  height: 14px !important;
  margin: 0 !important;
  border-radius: 0 !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
  background-size: contain !important;
  flex: 0 0 auto !important;
}

body.page-admin #admin-app .channel-badge[data-channel-tooltip].is-whatsapp::before,
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip].is-whatsapp::before {
  background-image: url("/static/shared/whatsapp-badge.svg?v=20260314a") !important;
}

body.page-admin #admin-app .channel-badge[data-channel-tooltip].is-web::before,
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip].is-web::before {
  background-image: url("/static/shared/web-badge.svg?v=20260314a") !important;
}

body.page-admin #admin-app .channel-badge[data-channel-tooltip].is-generic::before,
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip].is-generic::before {
  border-radius: 999px !important;
  background-image: radial-gradient(circle at 30% 30%, #c7d2fe 0%, #64748b 100%) !important;
}

body.page-admin #admin-app .channel-badge[data-channel-tooltip]::after,
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip]::after {
  content: attr(data-channel-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  padding: 5px 8px;
  border-radius: 8px;
  border: 1px solid rgba(120, 150, 192, 0.34);
  background: rgba(8, 14, 28, 0.96);
  color: #dbeafe;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.38);
  transition: opacity 0.14s ease, transform 0.14s ease;
  z-index: 18;
}

body.page-admin #admin-app .channel-badge[data-channel-tooltip]:hover::after,
body.page-admin #admin-app .channel-badge[data-channel-tooltip]:focus-visible::after,
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip]:hover::after,
body.page-admin #admin-app .message-channel-badge[data-channel-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.page-admin {
  --admin-border-muted-final: rgba(104, 132, 170, 0.2);
  --admin-border-strong-final: rgba(104, 132, 170, 0.28);
}

body.page-admin #auth-shell .auth-copy,
body.page-admin #auth-shell .auth-card,
body.page-admin #auth-shell .auth-tabs,
body.page-admin #auth-shell .auth-note,
body.page-admin #auth-shell .auth-highlights span,
body.page-admin #auth-shell .auth-form input,
body.page-admin #auth-shell .auth-form textarea,
body.page-admin #auth-shell .auth-form select,
body.page-admin #admin-app .topbar-field,
body.page-admin #admin-app .topbar-field select,
body.page-admin #admin-app .lead-toolbar,
body.page-admin #admin-app .lead-toolbar input,
body.page-admin #admin-app .lead-toolbar select,
body.page-admin #admin-app .list-card,
body.page-admin #admin-app .detail-card,
body.page-admin #admin-app .overview-hero,
body.page-admin #admin-app .overview-graph-card,
body.page-admin #admin-app .overview-table-card,
body.page-admin #admin-app .dashboard-card,
body.page-admin #admin-app .chart-card,
body.page-admin #admin-app .breakdown-card,
body.page-admin #admin-app .service-bar-track,
body.page-admin #admin-app .overview-live-track,
body.page-admin #admin-app .chart-track,
body.page-admin #admin-app .message-attachment-block,
body.page-admin #admin-app .message-attachment-block img,
body.page-admin #admin-app .message-attachment-block video {
  border-color: var(--admin-border-muted-final) !important;
}

body.page-admin #admin-app .service-bar-track,
body.page-admin #admin-app .overview-live-track,
body.page-admin #admin-app .chart-track {
  background: rgba(15, 23, 42, 0.5) !important;
}

/* Contact profile polish: avatar image + presence pills */
body.page-admin #admin-app .lead-row-avatar.has-photo {
  position: relative;
  overflow: hidden;
}

body.page-admin #admin-app .lead-row-avatar.has-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  border: 0 !important;
}

body.page-admin #admin-app .lead-row-avatar .lead-row-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* Loading ring on avatar while profile refresh is in-flight */
@keyframes avatar-refresh-spin {
  to { transform: rotate(360deg); }
}
body.page-admin #admin-app .lead-row-avatar.is-refreshing::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--admin-accent, #3757ff);
  animation: avatar-refresh-spin 0.9s linear infinite;
  pointer-events: none;
  z-index: 2;
}

body.page-admin #admin-app .contact-presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.56);
  color: #d9e4f7;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
  white-space: nowrap;
}

body.page-admin #admin-app .contact-presence-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #8ca3c7;
  box-shadow: 0 0 0 0 rgba(148, 163, 184, 0.42);
}

body.page-admin #admin-app .contact-presence-pill.is-online {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(16, 185, 129, 0.14);
  color: #bbf7d0;
}

body.page-admin #admin-app .contact-presence-pill.is-online::before {
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  animation: contactPresencePulse 1.8s ease-out infinite;
}

body.page-admin #admin-app .contact-presence-pill.is-offline {
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(148, 163, 184, 0.16);
  color: #d7e1f0;
}

body.page-admin #admin-app .contact-presence-pill.is-offline::before {
  background: #94a3b8;
}

body.page-admin #admin-app .contact-presence-pill.is-invisible {
  border-color: rgba(59, 130, 246, 0.32);
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
}

body.page-admin #admin-app .contact-presence-pill.is-invisible::before {
  background: #60a5fa;
}

body.page-admin #admin-app .contact-presence-pill.is-hidden {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.56);
  color: #b8c7e1;
}

body.page-admin #admin-app .contact-presence-pill.is-hidden::before {
  background: #64748b;
}

body.page-admin #admin-app .detail-presence-pill {
  margin-left: 8px;
}

body.page-admin #admin-app .detail-status-text {
  vertical-align: middle;
}

@keyframes contactPresencePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(34, 197, 94, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
  }
}

/* Final anti-white-border pass */
body.page-admin #auth-shell .auth-form input,
body.page-admin #auth-shell .auth-form textarea,
body.page-admin #auth-shell .auth-form select,
body.page-admin #auth-shell .auth-tabs,
body.page-admin #auth-shell .auth-copy,
body.page-admin #auth-shell .auth-card,
body.page-admin #auth-shell .auth-note,
body.page-admin #admin-app input,
body.page-admin #admin-app select,
body.page-admin #admin-app textarea,
body.page-admin #admin-app .service-bar-track,
body.page-admin #admin-app .overview-live-track,
body.page-admin #admin-app .chart-track,
body.page-admin #admin-app .message-attachment-block,
body.page-admin #admin-app .message-attachment-block img,
body.page-admin #admin-app .message-attachment-block video {
  border-color: rgba(104, 132, 170, 0.2) !important;
}

/* Presence icon-only mode */
body.page-admin #admin-app .contact-presence-pill {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  justify-content: center;
  font-size: 0;
  line-height: 0;
  border-radius: 999px;
}

body.page-admin #admin-app .contact-presence-pill::before {
  width: 8px;
  height: 8px;
}

body.page-admin #admin-app .detail-presence-pill {
  margin-left: 6px;
}

body.page-admin #admin-app .contacts-history-card {
  max-width: 760px;
  width: min(94vw, 760px);
  max-height: 80vh;
  display: grid;
  gap: 10px;
}

body.page-admin #admin-app .contacts-history-list {
  max-height: min(56vh, 540px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

body.page-admin #admin-app .history-row {
  border: 1px solid rgba(104, 132, 170, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 6px;
  background: rgba(8, 14, 28, 0.58);
}

body.page-admin #admin-app .history-row.is-archived {
  border-color: rgba(245, 158, 11, 0.36);
  background: rgba(36, 24, 6, 0.28);
}

body.page-admin #admin-app .history-row-head,
body.page-admin #admin-app .history-row-meta,
body.page-admin #admin-app .history-row-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

body.page-admin #admin-app .history-row-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: #9fb6db;
  font-size: 0.76rem;
}

body.page-admin #admin-app .history-row-state {
  border-radius: 999px;
  border: 1px solid rgba(104, 132, 170, 0.26);
  padding: 2px 8px;
}

body.page-admin #admin-app .history-row-preview {
  margin: 0;
  color: #c9d8f2;
  font-size: 0.82rem;
}

body.page-admin #admin-app .new-whatsapp-thread-contact-list {
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding: 2px 2px 2px 0;
}

body.page-admin #admin-app .new-whatsapp-thread-contact-item {
  width: 100%;
  border: 1px solid rgba(104, 132, 170, 0.2);
  border-radius: 10px;
  background: rgba(8, 14, 28, 0.58);
  color: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  text-align: left;
  cursor: pointer;
}

body.page-admin #admin-app .new-whatsapp-thread-contact-item:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(20, 30, 52, 0.72);
}

body.page-admin #admin-app .new-whatsapp-thread-contact-avatar {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  background: rgba(24, 49, 88, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #dbeafe;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
}

body.page-admin #admin-app .new-whatsapp-thread-contact-avatar.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.page-admin #admin-app .new-whatsapp-thread-contact-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

body.page-admin #admin-app .new-whatsapp-thread-contact-meta strong {
  font-size: 0.82rem;
  color: #e7f0ff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.page-admin #admin-app .new-whatsapp-thread-contact-meta span {
  font-size: 0.74rem;
  color: #9fb6db;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Keep moderation controls secondary in visual hierarchy */
#admin-app .message-admin-actions {
  gap: 4px;
  opacity: 0.72;
}

#admin-app .message-admin-actions .message-action-button.compact {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.6rem;
  letter-spacing: 0;
  line-height: 1;
}

#admin-app .message-admin-actions .message-action-button.compact.danger {
  color: #fda4af;
}

#admin-app .message-admin-actions .message-action-button.compact:hover {
  opacity: 1;
}

body.page-admin.site-3 #admin-app #lead-desk .message-admin-actions {
  opacity: 0.62 !important;
}

/* Final border cleanup: remove bright white strokes from hero tags + workspace selector */
body.page-admin #admin-app .hero-tags span {
  border-color: rgba(101, 129, 167, 0.2) !important;
  background: rgba(10, 18, 34, 0.68) !important;
  box-shadow: none !important;
}

body.page-admin #admin-app #tenant-switch-wrap.topbar-field,
body.page-admin #admin-app #tenant-switch-wrap.topbar-field #tenant-select,
body.page-admin #admin-app #overview .overview-workspace-slot #tenant-switch-wrap.topbar-field,
body.page-admin #admin-app #overview .overview-workspace-slot #tenant-select {
  border-color: rgba(101, 129, 167, 0.2) !important;
  box-shadow: none !important;
}

body.page-admin #admin-app #tenant-switch-wrap.topbar-field #tenant-select:focus,
body.page-admin #admin-app #tenant-switch-wrap.topbar-field #tenant-select:focus-visible {
  outline: none !important;
  border-color: rgba(96, 165, 250, 0.42) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.2) !important;
}

/* Conversation loading UX */
body.page-admin #admin-app #lead-desk .detail-card {
  position: relative;
}

body.page-admin #admin-app #lead-desk .detail-card.is-loading .detail-content {
  opacity: 0.32;
  pointer-events: none;
  filter: saturate(0.82);
}

body.page-admin #admin-app #lead-desk .detail-loading {
  position: absolute;
  top: 76px;
  right: 16px;
  left: 16px;
  min-height: 50px;
  border-radius: 12px;
  border: 1px solid rgba(101, 129, 167, 0.22);
  background: linear-gradient(180deg, rgba(7, 13, 26, 0.88) 0%, rgba(7, 13, 25, 0.8) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  z-index: 20;
}

body.page-admin #admin-app #lead-desk .detail-loading.hidden {
  display: none !important;
}

body.page-admin #admin-app #lead-desk .detail-loading-spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(150, 182, 223, 0.35);
  border-top-color: rgba(59, 130, 246, 0.95);
  animation: detail-loading-spin 0.72s linear infinite;
}

body.page-admin #admin-app #lead-desk .detail-loading-text {
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #d6e4fb;
}

body.page-admin #admin-app #lead-desk .lead-row.is-loading {
  border-color: rgba(96, 165, 250, 0.48) !important;
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.24) !important;
}

body.page-admin #admin-app #lead-desk .lead-row {
  position: relative;
}

body.page-admin #admin-app #lead-desk .lead-row.is-loading::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 2px solid rgba(148, 176, 218, 0.35);
  border-top-color: rgba(96, 165, 250, 0.95);
  animation: detail-loading-spin 0.72s linear infinite;
}

@keyframes detail-loading-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Hard override: no bright white borders on auth shell */
body.page-admin #auth-shell .auth-copy,
body.page-admin #auth-shell .auth-card,
body.page-admin #auth-shell .auth-tabs,
body.page-admin #auth-shell .auth-note,
body.page-admin #auth-shell .auth-highlights span,
body.page-admin #auth-shell .auth-form input,
body.page-admin #auth-shell .auth-form textarea,
body.page-admin #auth-shell .auth-form select {
  border-color: rgba(101, 129, 167, 0.2) !important;
}

body.page-admin #auth-shell .auth-form input:focus,
body.page-admin #auth-shell .auth-form input:focus-visible,
body.page-admin #auth-shell .auth-form textarea:focus,
body.page-admin #auth-shell .auth-form textarea:focus-visible,
body.page-admin #auth-shell .auth-form select:focus,
body.page-admin #auth-shell .auth-form select:focus-visible {
  outline: none !important;
  border-color: rgba(96, 165, 250, 0.44) !important;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22) !important;
}

/* Lead list head compact actions + filter modal */
body.page-admin #admin-app #lead-desk .lead-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

body.page-admin #admin-app #lead-desk .lead-list-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

body.page-admin #admin-app #lead-desk .compact-head-button {
  min-height: 34px !important;
  height: 34px !important;
  border-radius: 10px !important;
  padding: 0 10px !important;
  font-size: 0.74rem !important;
}

body.page-admin #admin-app #lead-desk #lead-filters-open-button.filter-active {
  border-color: rgba(96, 165, 250, 0.5) !important;
  color: #eaf2ff !important;
}

body.page-admin #admin-app #lead-desk .lead-filters-card {
  width: min(860px, calc(100vw - 28px));
  max-width: 860px;
}

body.page-admin #admin-app #lead-desk .lead-filters-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

body.page-admin #admin-app #lead-desk .lead-filters-card input,
body.page-admin #admin-app #lead-desk .lead-filters-card select {
  min-height: 40px;
  height: 40px;
}

@media (max-width: 900px) {
  body.page-admin #admin-app #lead-desk .lead-filters-grid {
    grid-template-columns: 1fr;
  }
}

/* Final responsive fit pass (desktop/tablet/mobile) */
body.page-admin #admin-app #lead-desk .lead-list-head-actions {
  max-width: 100%;
}

body.page-admin #admin-app #lead-desk .lead-list-head-actions .compact-head-button {
  white-space: nowrap;
}

body.page-admin #admin-app #lead-desk .lead-filters-card {
  max-height: min(84vh, 760px);
  overflow-y: auto;
}

body.page-admin #auth-shell .auth-copy,
body.page-admin #auth-shell .auth-card,
body.page-admin #auth-shell .auth-tabs,
body.page-admin #auth-shell .auth-note,
body.page-admin #auth-shell .auth-form input,
body.page-admin #auth-shell .auth-form textarea,
body.page-admin #auth-shell .auth-form select {
  box-shadow: none !important;
}

body.page-admin #auth-shell .auth-form input:focus,
body.page-admin #auth-shell .auth-form input:focus-visible,
body.page-admin #auth-shell .auth-form textarea:focus,
body.page-admin #auth-shell .auth-form textarea:focus-visible,
body.page-admin #auth-shell .auth-form select:focus,
body.page-admin #auth-shell .auth-form select:focus-visible {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22) !important;
}

@media (max-width: 900px) {
  body.page-admin #admin-app #lead-desk .lead-list-head {
    align-items: stretch;
    gap: 8px;
  }

  body.page-admin #admin-app #lead-desk .lead-list-head-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  body.page-admin #admin-app #lead-desk .lead-list-head-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body.page-admin #admin-app #lead-desk .compact-head-button {
    width: 100%;
    justify-content: center;
    min-height: 32px !important;
    height: 32px !important;
    padding: 0 8px !important;
    font-size: 0.7rem !important;
  }

  body.page-admin #admin-app #lead-desk .lead-filters-card {
    width: min(96vw, 860px);
    padding: 14px;
  }

  body.page-admin #admin-app #lead-desk .lead-filters-grid {
    gap: 8px;
  }
}

@media (max-width: 560px) {
  body.page-admin #admin-app #lead-desk #queue-count.status-pill {
    min-height: 30px !important;
    height: 30px !important;
    font-size: 0.68rem !important;
    padding: 0 8px !important;
  }
}

/* Lead list/detail linear alignment */
body.page-admin.site-3 #admin-app[data-active-admin-tab="lead-desk"] #lead-desk.lead-desk-shell {
  align-items: stretch !important;
}

body.page-admin.site-3 #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .list-card,
body.page-admin.site-3 #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .detail-card {
  margin: 0 !important;
  align-self: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
}

body.page-admin.site-3 #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .list-card {
  display: flex !important;
  flex-direction: column !important;
  border-right: 1px solid rgba(104, 132, 170, 0.2) !important;
  border-radius: 0 !important;
}

body.page-admin.site-3 #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .section-head.lead-list-head {
  margin: 0 !important;
  padding: 10px 12px 8px !important;
  border-bottom: 1px solid rgba(104, 132, 170, 0.16) !important;
}

body.page-admin.site-3 #admin-app[data-active-admin-tab="lead-desk"] #lead-desk #lead-list.lead-list {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 10px 10px 12px !important;
  box-sizing: border-box !important;
}

@media (max-width: 1120px) {
  body.page-admin.site-3 #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .list-card {
    border-right: 0 !important;
    border-radius: 12px !important;
  }
}

/* Cross-variant desktop linearity: contact list and chat share full-height columns */
@media (min-width: 1121px) {
  body.page-admin #admin-app[data-active-admin-tab="lead-desk"] #lead-desk.lead-desk-shell {
    align-items: stretch !important;
  }

  body.page-admin #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .list-card,
  body.page-admin #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .detail-card {
    margin: 0 !important;
    align-self: stretch !important;
    block-size: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
  }

  body.page-admin #admin-app[data-active-admin-tab="lead-desk"] #lead-desk .list-card {
    display: grid !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
  }

  body.page-admin #admin-app[data-active-admin-tab="lead-desk"] #lead-desk #lead-list.lead-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: auto !important;
    scrollbar-gutter: stable both-edges !important;
    margin: 0 !important;
    padding-bottom: 18px !important;
    box-sizing: border-box !important;
  }

  body.page-admin #admin-app[data-active-admin-tab="lead-desk"] #lead-desk #detail-content.detail-content {
    height: 100% !important;
    min-height: 0 !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   AUTH SHELL — forced dark-context overrides
   These rules run last and have the highest specificity to cancel
   any light-theme resets applied by body.page-admin rules above.
   ═══════════════════════════════════════════════════════════════ */

/* Auth-shell keeps its own dark canvas */
#auth-shell.auth-shell {
  background: linear-gradient(160deg, #0d0b1a 0%, #111827 100%) !important;
  border-radius: 32px !important;
  overflow: hidden !important;
  margin-top: 24px !important;
}

#auth-shell.auth-shell::before {
  display: none !important;
}

#auth-shell.auth-shell::after {
  display: none !important;
}

/* Panel is transparent — no white card behind the left + right columns */
#auth-shell .auth-panel {
  background: none !important;
  border: none !important;
  box-shadow: none !important;
  padding: 40px 36px !important;
  gap: 64px !important;
  grid-template-columns: 1fr 460px !important;
  align-items: center !important;
}

@media (max-width: 960px) {
  #auth-shell .auth-panel {
    grid-template-columns: 1fr !important;
    gap: 36px !important;
    padding: 32px 24px !important;
  }
}

/* Left copy: typography on dark bg */
#auth-shell .auth-copy h1 {
  color: #ffffff !important;
  font-size: clamp(2.2rem, 3.8vw, 3.6rem) !important;
  line-height: 1.0 !important;
  letter-spacing: -0.055em !important;
  font-weight: 800 !important;
  text-shadow: none !important;
}

#auth-shell .auth-copy p {
  color: rgba(255, 255, 255, 0.58) !important;
  font-size: 1.02rem !important;
  line-height: 1.68 !important;
  max-width: 44ch !important;
}

#auth-shell .auth-eyebrow {
  color: #b8aaff !important;
  background: rgba(122, 92, 255, 0.14) !important;
  border-color: rgba(122, 92, 255, 0.3) !important;
}

#auth-shell .auth-feature-list li {
  color: rgba(255, 255, 255, 0.6) !important;
  font-size: 0.9rem !important;
}

#auth-shell .auth-feature-icon {
  background: rgba(73, 201, 123, 0.18) !important;
  border-color: rgba(73, 201, 123, 0.35) !important;
}

#auth-shell .auth-brand-mark {
  color: #fff !important;
}

/* Right card: glass panel */
#auth-shell .auth-card {
  background: rgba(18, 12, 32, 0.72) !important;
  backdrop-filter: blur(32px) saturate(170%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(170%) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow:
    0 40px 100px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06) !important;
  border-radius: 28px !important;
  padding: 32px !important;
}

/* Tabs */
#auth-shell .auth-tabs {
  background: rgba(0, 0, 0, 0.3) !important;
  border-color: rgba(255, 255, 255, 0.07) !important;
  border-radius: 16px !important;
  padding: 5px !important;
}

#auth-shell .auth-tab {
  color: rgba(255, 255, 255, 0.4) !important;
  background: transparent !important;
  border-color: transparent !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
}

#auth-shell .auth-tab.active {
  background: rgba(255, 255, 255, 0.93) !important;
  color: #0a0616 !important;
  border-color: transparent !important;
}

#auth-shell .auth-tab:not(.active):hover {
  color: rgba(255, 255, 255, 0.72) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

/* Input labels */
#auth-shell .auth-input-group label {
  color: rgba(255, 255, 255, 0.48) !important;
  font-weight: 600 !important;
  font-size: 0.76rem !important;
}

/* Inputs */
#auth-shell .auth-form input,
#auth-shell .auth-form textarea,
#auth-shell .auth-form select {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.11) !important;
  color: #ffffff !important;
  border-radius: 14px !important;
  box-shadow: none !important;
}

#auth-shell .auth-form input::placeholder,
#auth-shell .auth-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.24) !important;
}

#auth-shell .auth-form input:focus,
#auth-shell .auth-form textarea:focus,
#auth-shell .auth-form select:focus {
  background: rgba(255, 255, 255, 0.09) !important;
  border-color: rgba(122, 92, 255, 0.65) !important;
  box-shadow: 0 0 0 3px rgba(122, 92, 255, 0.18) !important;
  outline: none !important;
}

/* Submit button */
#auth-shell .auth-submit-btn {
  background: linear-gradient(135deg, #7a5cff 0%, #5e3fe0 100%) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 14px 32px rgba(122, 92, 255, 0.32) !important;
  height: 52px !important;
  border-radius: 14px !important;
  font-size: 0.93rem !important;
  font-weight: 700 !important;
}

#auth-shell .auth-submit-btn:hover:not(:disabled) {
  transform: translateY(-1px) !important;
  box-shadow: 0 20px 40px rgba(122, 92, 255, 0.42) !important;
}

/* Ghost / link buttons */
#auth-shell .auth-ghost-btn {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.65) !important;
}

#auth-shell .auth-ghost-btn:hover {
  background: rgba(255, 255, 255, 0.09) !important;
  color: #fff !important;
}

#auth-shell .auth-link-btn {
  color: rgba(255, 255, 255, 0.38) !important;
  background: none !important;
  border: none !important;
}

#auth-shell .auth-link-btn:hover {
  color: rgba(255, 255, 255, 0.68) !important;
}

/* Sub form */
#auth-shell .auth-sub-form {
  background: rgba(0, 0, 0, 0.18) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

/* CAPTCHA bar */
#auth-shell .auth-captcha-bar {
  background: rgba(73, 201, 123, 0.06) !important;
  border-color: rgba(73, 201, 123, 0.2) !important;
  color: rgba(255, 255, 255, 0.42) !important;
}

#auth-shell .auth-captcha-bar.verified {
  border-color: rgba(73, 201, 123, 0.42) !important;
  color: rgba(73, 201, 123, 0.88) !important;
}

#auth-shell .auth-captcha-bar.error {
  border-color: rgba(255, 100, 100, 0.42) !important;
  color: rgba(255, 130, 130, 0.88) !important;
}

/* Feedback text */
#auth-shell .auth-feedback {
  color: #ff8c8c !important;
}

#auth-shell .auth-feedback.success {
  color: #6ee7a8 !important;
}

/* Demo note */
#auth-shell .auth-demo-note {
  background: rgba(122, 92, 255, 0.08) !important;
  border-color: rgba(122, 92, 255, 0.2) !important;
}

#auth-shell .auth-demo-note code {
  color: rgba(255, 255, 255, 0.52) !important;
  background: rgba(255, 255, 255, 0.07) !important;
}

/* Security footer */
#auth-shell .auth-security-footer {
  color: rgba(255, 255, 255, 0.28) !important;
  border-top-color: rgba(255, 255, 255, 0.07) !important;
}
/* ═══════════════════════════════════════════════════════════════ */

/* ── Page boot screen ─────────────────────────────────────────── */
.page-boot-screen {
  position: fixed !important;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background:
    radial-gradient(circle at 78% 8%, rgba(132, 77, 255, 0.22) 0, rgba(132, 77, 255, 0.08) 18%, transparent 38%),
    radial-gradient(circle at 62% 4%, rgba(255, 109, 31, 0.16) 0, rgba(255, 109, 31, 0.06) 16%, transparent 30%),
    linear-gradient(180deg, #130c21 0%, #0d0817 26%, #0a0712 68%, #090510 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.page-boot-screen.boot-fading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.boot-logo {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 28px rgba(255, 109, 31, 0.65));
  animation: boot-pulse 2.4s ease-in-out infinite;
}

.boot-wordmark {
  font-family: "Manrope", "Geomanist", "Segoe UI", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #ff6d1f 0%, #c36bff 60%, #7a5cff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.boot-loader {
  width: 220px;
}

.boot-loader-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 99px;
  overflow: hidden;
}

.boot-loader-fill {
  height: 100%;
  width: 45%;
  background: linear-gradient(90deg, rgba(255, 109, 31, 0) 0%, #ff6d1f 35%, #7a5cff 70%, rgba(122, 92, 255, 0) 100%);
  border-radius: 99px;
  animation: boot-slide 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.boot-tagline {
  font-family: "Manrope", "Geomanist", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(246, 241, 255, 0.35);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0;
}

@keyframes boot-pulse {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 0 28px rgba(255, 109, 31, 0.65));
  }
  50% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 42px rgba(255, 109, 31, 0.9)) drop-shadow(0 0 70px rgba(122, 92, 255, 0.35));
  }
}

@keyframes boot-slide {
  0% { transform: translateX(-120%); }
  50% { transform: translateX(190%); }
  100% { transform: translateX(-120%); }
}

/* ── Archive confirm bar ───────────────────────────────────────── */
#admin-app .archive-confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  margin: 0 0 10px;
  background: rgba(255, 125, 125, 0.08);
  border: 1px solid rgba(255, 125, 125, 0.3);
  border-radius: var(--radius-sm);
  animation: confirm-slide-in 0.2s cubic-bezier(0.2, 0, 0, 1);
}

#admin-app .archive-confirm-bar.hidden {
  display: none;
}

#admin-app .archive-confirm-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

#admin-app .archive-confirm-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

#admin-app .archive-confirm-text {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--admin-danger);
  line-height: 1.4;
}

#admin-app .archive-confirm-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

@keyframes confirm-slide-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile navigation drawer ────────────────────────────────────── */

/* Hamburger toggle button */
.admin-mobile-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid #dbe4ef;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
}

.admin-mobile-toggle:hover {
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.13);
}

.admin-mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #0f172a;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s;
}

body.mobile-nav-open .admin-mobile-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

body.mobile-nav-open .admin-mobile-toggle span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

body.mobile-nav-open .admin-mobile-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Overlay backdrop */
.admin-mobile-overlay {
  position: fixed;
  inset: 0;
  z-index: 199;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(3px);
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.mobile-nav-open .admin-mobile-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* Mobile breakpoint: brandbar becomes left-side drawer */
@media (max-width: 820px) {
  .admin-mobile-toggle {
    display: flex;
  }

  .admin-brandbar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    width: min(300px, 88vw);
    padding: 0;
    transform: translateX(-100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.mobile-nav-open .admin-brandbar {
    transform: translateX(0);
  }

  .admin-brandbar-inner {
    height: 100%;
    width: 100%;
    min-height: 100%;
    border-radius: 0 20px 20px 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px 14px 28px;
    gap: 0;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 4px 0 32px rgba(15, 23, 42, 0.13);
  }

  .admin-mark {
    display: block;
    padding: 10px 4px 18px;
    border-bottom: 1px solid #e8eef5;
    margin-bottom: 10px;
    font-size: 1.06rem;
  }

  .admin-brandnav {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    overflow: visible;
    flex: 1;
  }

  .admin-navtab,
  .admin-navlink {
    justify-content: flex-start;
    min-height: 46px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 0.93rem;
  }

  .admin-sidepanel {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #e8eef5;
  }

  .admin-shell {
    padding-top: 72px;
  }

  .admin-brandbar-inner,
  .admin-shell {
    width: 100%;
    margin: 0;
  }
}

@media (min-width: 821px) {
  .admin-mobile-toggle,
  .admin-mobile-overlay {
    display: none !important;
  }
}

/* Final auth override: simple, clean, mobile-perfect */
body.page-admin #auth-shell.auth-shell.hidden {
  display: none !important;
}

body.page-admin #auth-shell.auth-shell {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 16px !important;
  min-height: 100vh !important;
  border-radius: 0 !important;
  background: #0b1220 !important;
  display: grid !important;
  place-items: center !important;
}

body.page-admin #auth-shell.auth-shell::before,
body.page-admin #auth-shell.auth-shell::after {
  display: none !important;
}

body.page-admin #auth-shell .auth-panel {
  width: min(760px, 100%) !important;
  max-width: 760px !important;
  margin: 0 auto !important;
  padding: 0 !important;
  display: block !important;
}

body.page-admin #auth-shell[data-auth-mode="register"] .auth-panel {
  width: min(760px, 100%) !important;
  max-width: 760px !important;
}

body.page-admin #auth-shell[data-auth-mode="login"] .auth-panel {
  width: min(520px, 100%) !important;
  max-width: 520px !important;
}

body.page-admin #auth-shell .auth-copy,
body.page-admin #auth-shell .auth-security-footer,
body.page-admin #auth-shell .auth-demo-note {
  display: none !important;
}

body.page-admin #auth-shell .auth-card {
  width: 100% !important;
  padding: 20px !important;
  border-radius: 16px !important;
  border: 1px solid rgba(148, 163, 184, 0.24) !important;
  background: #0f1b31 !important;
  box-shadow: 0 12px 32px rgba(2, 6, 23, 0.24) !important;
  backdrop-filter: none !important;
}

body.page-admin #auth-shell .auth-back-home {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-bottom: 14px !important;
  padding: 6px 10px !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 10px !important;
  background: rgba(15, 27, 49, 0.72) !important;
  color: #cbd5e1 !important;
  font-weight: 600 !important;
}

body.page-admin #auth-shell .auth-back-home:hover {
  background: rgba(37, 99, 235, 0.18) !important;
  border-color: rgba(96, 165, 250, 0.42) !important;
  color: #e2e8f0 !important;
}

body.page-admin #auth-shell .auth-back-arrow {
  font-size: 14px !important;
  opacity: 0.9 !important;
}

body.page-admin #auth-shell .auth-form {
  gap: 11px !important;
}

body.page-admin #auth-shell #register-form.hidden,
body.page-admin #auth-shell #login-form.hidden {
  display: none !important;
}

body.page-admin #auth-shell .auth-input-group input {
  height: 44px !important;
  border-radius: 10px !important;
  background: #0a1426 !important;
  border-color: rgba(148, 163, 184, 0.25) !important;
}

body.page-admin #auth-shell .auth-input-row {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

@media (min-width: 1024px) {
  body.page-admin #auth-shell .auth-card {
    padding: 22px !important;
  }

  body.page-admin #auth-shell #register-form:not(.hidden) {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    column-gap: 12px !important;
    row-gap: 10px !important;
    align-items: start !important;
  }

  body.page-admin #auth-shell #register-form > :nth-child(3),
  body.page-admin #auth-shell #register-form > :nth-child(4),
  body.page-admin #auth-shell #register-form > :nth-child(5),
  body.page-admin #auth-shell #register-form > :nth-child(6),
  body.page-admin #auth-shell #register-form > :nth-child(7) {
    grid-column: 1 / -1 !important;
  }
}

@media (min-width: 640px) and (max-width: 1023px) {
  body.page-admin #auth-shell[data-auth-mode="register"] .auth-panel {
    width: min(620px, 100%) !important;
    max-width: 620px !important;
  }

  body.page-admin #auth-shell[data-auth-mode="login"] .auth-panel {
    width: min(500px, 100%) !important;
    max-width: 500px !important;
  }
}

body.page-admin #auth-shell .auth-submit-btn {
  height: 46px !important;
  border-radius: 10px !important;
  background: #2563eb !important;
  box-shadow: none !important;
}

body.page-admin #auth-shell .auth-submit-btn:hover:not(:disabled) {
  transform: none !important;
  background: #1d4ed8 !important;
}

@media (max-width: 640px) {
  body.page-admin #auth-shell.auth-shell {
    padding: 12px !important;
  }

  body.page-admin #auth-shell .auth-card {
    padding: 14px !important;
  }
}
