/* WAHA PRO V21.40 — Admin quality tokens, contrast guardrails and responsive QA
   Scope: only dashboard/admin and recently-added contact metadata surfaces.
   Rationale: keep new component fixes isolated from legacy public theme CSS. */
:root {
  --waha-admin-bg: #06172f;
  --waha-admin-surface: #0d2445;
  --waha-admin-surface-2: #132d51;
  --waha-admin-card: #102640;
  --waha-admin-card-2: #182f4e;
  --waha-admin-ink: #f8fbff;
  --waha-admin-text: #e8f1ff;
  --waha-admin-muted: #b9cbe2;
  --waha-admin-soft: #8fb5de;
  --waha-admin-line: rgba(166, 205, 255, .22);
  --waha-admin-blue: #2f8cff;
  --waha-admin-blue-strong: #0b62d8;
  --waha-admin-focus: #8bc4ff;
  --waha-admin-shadow: 0 22px 60px rgba(0, 0, 0, .28);
  --waha-admin-radius: 22px;
}

body.admin-route-active {
  background: #071426 !important;
  color: var(--waha-admin-text) !important;
}
body.admin-route-active .admin-main,
body.admin-route-active .dedicated-dashboard-shell {
  color: var(--waha-admin-text) !important;
}
body.admin-route-active .admin-main h1,
body.admin-route-active .admin-main h2,
body.admin-route-active .admin-main h3,
body.admin-route-active .admin-main h4,
body.admin-route-active .admin-main b,
body.admin-route-active .admin-head h1 {
  color: var(--waha-admin-ink) !important;
  text-shadow: none !important;
}
body.admin-route-active .admin-main p,
body.admin-route-active .admin-main li,
body.admin-route-active .admin-main small,
body.admin-route-active .admin-main label,
body.admin-route-active .admin-main .muted,
body.admin-route-active .admin-main .muted2 {
  color: var(--waha-admin-muted) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
body.admin-route-active .card:not(.dashboard-global-search-card):not(.builder-pro-hero),
body.admin-route-active .admin-help,
body.admin-route-active .table-wrap,
body.admin-route-active .form-builder-card,
body.admin-route-active .lead-stage-card {
  background: linear-gradient(145deg, rgba(24, 47, 78, .96), rgba(12, 31, 57, .98)) !important;
  color: var(--waha-admin-text) !important;
  border: 1px solid var(--waha-admin-line) !important;
  box-shadow: var(--waha-admin-shadow) !important;
}
body.admin-route-active .card:not(.dashboard-global-search-card):not(.builder-pro-hero) h2,
body.admin-route-active .card:not(.dashboard-global-search-card):not(.builder-pro-hero) h3,
body.admin-route-active .card:not(.dashboard-global-search-card):not(.builder-pro-hero) b,
body.admin-route-active .lead-stage-card b {
  color: var(--waha-admin-ink) !important;
}
body.admin-route-active input,
body.admin-route-active select,
body.admin-route-active textarea {
  background: #edf5ff !important;
  color: #07172e !important;
  border: 1px solid rgba(142, 186, 238, .75) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55) !important;
}
body.admin-route-active input::placeholder,
body.admin-route-active textarea::placeholder {
  color: #53677e !important;
  opacity: 1 !important;
}
body.admin-route-active input:focus,
body.admin-route-active select:focus,
body.admin-route-active textarea:focus,
body.admin-route-active button:focus-visible,
body.admin-route-active a:focus-visible {
  outline: 3px solid rgba(139, 196, 255, .88) !important;
  outline-offset: 2px !important;
}
body.admin-route-active .btn.primary {
  background: linear-gradient(135deg, #0b62d8, #0e7df0) !important;
  color: #fff !important;
  border-color: rgba(147, 197, 253, .42) !important;
  text-shadow: none !important;
}
body.admin-route-active .btn.secondary,
body.admin-route-active .btn.ghost,
body.admin-route-active .btn.small.secondary {
  background: rgba(17, 36, 66, .94) !important;
  color: #f8fbff !important;
  border: 1px solid rgba(180, 210, 250, .35) !important;
  text-shadow: none !important;
}
body.admin-route-active .btn.secondary:hover,
body.admin-route-active .btn.primary:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

/* Dashboard overview search: isolated light surface with guaranteed readable controls. */
body.admin-route-active .dashboard-global-search-card,
body.dark.admin-route-active .dashboard-global-search-card {
  background: linear-gradient(135deg, #ffffff 0%, #f2f8ff 55%, #eaf4ff 100%) !important;
  color: #07172e !important;
  border: 1px solid rgba(42, 119, 218, .26) !important;
  box-shadow: 0 28px 70px rgba(0, 0, 0, .22) !important;
}
body.admin-route-active .dashboard-global-search-card h2,
body.admin-route-active .dashboard-global-search-card p,
body.admin-route-active .dashboard-global-search-card label,
body.admin-route-active .dashboard-global-search-card b,
body.admin-route-active .dashboard-global-search-card span:not(.eyebrow),
body.admin-route-active .dashboard-global-search-card .dashboard-search-results a,
body.admin-route-active .dashboard-global-search-card .dashboard-search-results a span {
  color: #07172e !important;
  opacity: 1 !important;
}
body.admin-route-active .dashboard-global-search-card .eyebrow {
  color: #064ba7 !important;
  background: #e7f1ff !important;
  border-color: rgba(10, 88, 202, .28) !important;
}
body.admin-route-active .dashboard-search-box .btn,
body.admin-route-active .dashboard-global-search-card .btn {
  min-height: 48px;
  color: #fff !important;
  background: linear-gradient(135deg, #0b62d8, #0e7df0) !important;
  border: 1px solid rgba(10, 88, 202, .22) !important;
}
body.admin-route-active .dashboard-search-results a {
  background: linear-gradient(135deg, #ffffff, #edf6ff) !important;
  border-color: rgba(10, 88, 202, .22) !important;
}
body.admin-route-active .dashboard-search-results a b { color: #053d8f !important; }
body.admin-route-active .dashboard-search-pending { color: #0f172a !important; background: #eaf4ff !important; }

/* SEO Intelligence: fix dark-card numbers and labels. */
body.admin-route-active .seo-intelligence-hero {
  background: linear-gradient(135deg, #082653, #0b62d8) !important;
  border-color: rgba(166, 205, 255, .26) !important;
}
body.admin-route-active .seo-intelligence-hero h2,
body.admin-route-active .seo-intelligence-hero .eyebrow,
body.admin-route-active .seo-intelligence-gauge b,
body.admin-route-active .seo-intelligence-gauge span {
  color: #fff !important;
}
body.admin-route-active .seo-intelligence-hero .muted {
  color: #dbeafe !important;
}
body.admin-route-active .seo-intelligence-grid .card h3 {
  color: #f8fbff !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
body.admin-route-active .seo-intelligence-grid .card .muted,
body.admin-route-active .seo-intelligence-grid .card p {
  color: #dbeafe !important;
}
body.admin-route-active .seo-intelligence-table small,
body.admin-route-active .admin-table small {
  color: #bfd5ee !important;
}
body.admin-route-active .seo-issue.warn { background: rgba(251, 191, 36, .16) !important; color: #fde68a !important; border-color: rgba(251, 191, 36, .30) !important; }
body.admin-route-active .seo-issue.bad { background: rgba(251, 113, 133, .16) !important; color: #fecdd3 !important; border-color: rgba(251, 113, 133, .30) !important; }

/* Public contact privacy notice: no washed-out gray on dark cards. */
.managed-lead-form .lead-privacy-notice,
.contact-intel-card + .card .lead-privacy-notice {
  background: linear-gradient(135deg, rgba(8, 38, 83, .96), rgba(13, 45, 81, .94)) !important;
  color: #dbeafe !important;
  border: 1px solid rgba(139, 196, 255, .34) !important;
  box-shadow: 0 18px 45px rgba(2, 12, 28, .20) !important;
}
.managed-lead-form .lead-privacy-notice b,
.contact-intel-card + .card .lead-privacy-notice b {
  color: #8bc4ff !important;
}
.managed-lead-form .lead-privacy-notice p,
.contact-intel-card + .card .lead-privacy-notice p {
  color: #dbeafe !important;
  opacity: 1 !important;
}

/* Legacy image cleanup: clear visual fallback rather than broken blank blocks. */
.waha-image-fallback,
.waha-legacy-image-replaced {
  object-fit: cover !important;
  background: linear-gradient(135deg, #0b62d8, #052b67) !important;
}

/* Dashboard long-screen QA for 1920x1080 / Windows 125% and mobile. */
body.admin-route-active .admin-main {
  min-width: 0 !important;
  max-width: 100% !important;
  padding: clamp(14px, 1.4vw, 24px) !important;
  scroll-padding-bottom: 140px;
}
body.admin-route-active .admin-head,
body.admin-route-active .dashboard-command-bar,
body.admin-route-active .governance-toolbar,
body.admin-route-active .actions {
  flex-wrap: wrap !important;
  min-width: 0 !important;
}
body.admin-route-active .admin-head .actions,
body.admin-route-active .dashboard-command-actions {
  gap: 10px !important;
}
body.admin-route-active .admin-head .actions .btn,
body.admin-route-active .dashboard-command-actions .btn {
  white-space: normal !important;
  text-align: center !important;
  justify-content: center !important;
}
body.admin-route-active .grid.two,
body.admin-route-active .hero-studio-grid,
body.admin-route-active .media-studio-hero,
body.admin-route-active .security-center-hero,
body.admin-route-active .backup-restore-hero,
body.admin-route-active .release-center-hero {
  gap: clamp(14px, 1.4vw, 22px) !important;
}
@media (max-width: 1700px) {
  body.admin-route-active .admin-shell.v9-admin-shell:not(.admin-collapsed) {
    grid-template-columns: 260px minmax(0, 1fr) !important;
  }
  body.admin-route-active .admin-shell.v9-admin-shell:not(.admin-collapsed) .admin-side {
    width: 260px !important;
  }
  body.admin-route-active .grid.two,
  body.admin-route-active .hero-studio-grid,
  body.admin-route-active .media-studio-hero,
  body.admin-route-active .builder-pro-hero {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}
@media (max-width: 980px) {
  body.admin-route-active .admin-main { padding: 12px 10px 120px !important; }
  body.admin-route-active .admin-table { min-width: 680px !important; }
  body.admin-route-active .card { border-radius: 18px !important; }
  body.admin-route-active .dashboard-global-search-card { padding: 16px !important; }
  body.admin-route-active .dashboard-search-box { grid-template-columns: 1fr !important; }
  body.admin-route-active .seo-intelligence-hero { grid-template-columns: 1fr !important; }
  body.admin-route-active .seo-intelligence-gauge { width: 112px !important; height: 112px !important; }
}
@media (max-width: 560px) {
  body.admin-route-active .admin-head h1 { font-size: clamp(1.45rem, 8vw, 2rem) !important; }
  body.admin-route-active .admin-head .actions .btn,
  body.admin-route-active .dashboard-command-actions .btn,
  body.admin-route-active .actions .btn { flex: 1 1 100% !important; width: 100% !important; }
  body.admin-route-active .seo-intelligence-grid,
  body.admin-route-active .stats-admin,
  body.admin-route-active .governance-stats { grid-template-columns: minmax(0, 1fr) !important; }
}


/* V21.41.6 — Admin UI/UX contrast recovery, readable editor surfaces and media governance spacing */
body.admin-route-active .rich-editor,
body.admin-route-active .rich-output,
body.admin-route-active .rich-editor p,
body.admin-route-active .rich-editor li,
body.admin-route-active .rich-editor div,
body.admin-route-active .rich-editor span,
body.admin-route-active .rich-editor strong,
body.admin-route-active .rich-editor em,
body.admin-route-active .rich-editor h1,
body.admin-route-active .rich-editor h2,
body.admin-route-active .rich-editor h3,
body.admin-route-active .rich-editor h4,
body.admin-route-active .rich-editor th,
body.admin-route-active .rich-editor td,
body.admin-route-active .rich-output p,
body.admin-route-active .rich-output li,
body.admin-route-active .rich-output h1,
body.admin-route-active .rich-output h2,
body.admin-route-active .rich-output h3,
body.admin-route-active .rich-output h4,
body.admin-route-active .rich-output th,
body.admin-route-active .rich-output td {
  color: #0b1b35 !important;
  text-shadow: none !important;
  opacity: 1 !important;
}
body.admin-route-active .rich-editor,
body.admin-route-active .rich-output {
  background: #ffffff !important;
  border: 1px solid rgba(10, 88, 202, .18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 10px 26px rgba(4, 22, 45, .08) !important;
}
body.admin-route-active .rich-editor a,
body.admin-route-active .rich-output a {
  color: #0a58ca !important;
}
body.admin-route-active .rich-editor blockquote,
body.admin-route-active .rich-output blockquote {
  color: #16324f !important;
  background: #eef5ff !important;
  border-color: #0a58ca !important;
}
body.admin-route-active .code-area,
body.admin-route-active textarea.code-area,
body.admin-route-active pre.code-area {
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 100%) !important;
  color: #0b1b35 !important;
  border: 1px solid rgba(10, 88, 202, .18) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55) !important;
}

body.admin-route-active .security-check-card {
  background: linear-gradient(145deg, rgba(24, 47, 78, .98), rgba(12, 31, 57, .98)) !important;
  border: 1px solid rgba(166, 205, 255, .18) !important;
  box-shadow: var(--waha-admin-shadow) !important;
}
body.admin-route-active .security-check-card span,
body.admin-route-active .security-check-card small,
body.admin-route-active .security-check-card p {
  color: var(--waha-admin-muted) !important;
}
body.admin-route-active .security-check-card b,
body.admin-route-active .security-check-card h3 {
  color: var(--waha-admin-ink) !important;
}
body.admin-route-active .security-check-card.good {
  background: linear-gradient(145deg, rgba(20, 83, 45, .88), rgba(12, 31, 57, .98)) !important;
  border-color: rgba(74, 222, 128, .28) !important;
}
body.admin-route-active .security-check-card.warn {
  background: linear-gradient(145deg, rgba(120, 53, 15, .88), rgba(12, 31, 57, .98)) !important;
  border-color: rgba(251, 191, 36, .32) !important;
}
body.admin-route-active .security-check-card.bad {
  background: linear-gradient(145deg, rgba(127, 29, 29, .88), rgba(12, 31, 57, .98)) !important;
  border-color: rgba(248, 113, 113, .32) !important;
}

body.admin-route-active .builder-pro-hero,
body.admin-route-active .dashboard-global-search-card {
  box-shadow: 0 24px 56px rgba(2, 18, 43, .20) !important;
}
body.admin-route-active .builder-pro-hero {
  background: linear-gradient(135deg, #ffffff 0%, #eef6ff 52%, #f7fbff 100%) !important;
  border: 1px solid rgba(10, 88, 202, .18) !important;
}
body.admin-route-active .builder-pro-hero h2,
body.admin-route-active .builder-pro-hero b,
body.admin-route-active .builder-pro-hero .builder-pro-metrics b,
body.admin-route-active .builder-pro-hero .builder-pro-metrics strong {
  color: #0b1e3b !important;
}
body.admin-route-active .builder-pro-hero p,
body.admin-route-active .builder-pro-hero .muted,
body.admin-route-active .builder-pro-hero .builder-pro-metrics span {
  color: #475569 !important;
}
body.admin-route-active .builder-pro-hero .eyebrow {
  color: #0a58ca !important;
  background: rgba(10, 88, 202, .09) !important;
  border-color: rgba(10, 88, 202, .22) !important;
}
body.admin-route-active .builder-pro-metrics span {
  background: #ffffff !important;
  border: 1px solid rgba(10, 88, 202, .14) !important;
  box-shadow: 0 14px 30px rgba(2, 30, 70, .08) !important;
}

body.admin-route-active .lead-inbox-table td,
body.admin-route-active .lead-inbox-table th {
  vertical-align: top !important;
}
body.admin-route-active .lead-inbox-table .lead-message-preview {
  color: #dbeafe !important;
  max-width: 420px !important;
  line-height: 1.7 !important;
}
body.admin-route-active .lead-inbox-table [data-lead-followup],
body.admin-route-active .lead-inbox-table [data-lead-stage],
body.admin-route-active .lead-inbox-table [data-lead-notes] {
  width: 100% !important;
  max-width: 100% !important;
}
body.admin-route-active .lead-inbox-table textarea[data-lead-notes] {
  min-height: 86px !important;
}
body.admin-route-active .lead-intel-summary span,
body.admin-route-active .lead-intel-summary small {
  background: rgba(148, 163, 184, .14) !important;
  border: 1px solid rgba(166, 205, 255, .18) !important;
  color: #dbeafe !important;
}
body.admin-route-active .lead-intel-summary small {
  color: #b9cbe2 !important;
}
body.admin-route-active .lead-intel-summary .lead-score.good {
  background: rgba(34, 197, 94, .18) !important;
  border-color: rgba(34, 197, 94, .30) !important;
  color: #dcfce7 !important;
}
body.admin-route-active .lead-intel-summary .lead-score.warn {
  background: rgba(245, 158, 11, .18) !important;
  border-color: rgba(245, 158, 11, .32) !important;
  color: #fde68a !important;
}


/* V21.41.6 patch — Media Library card readability on light surfaces.
   The global admin dark-theme text rule is intentionally overridden here because
   media cards use a light surface for URL/input legibility. */
body.admin-route-active .media-library-card,
body.dark.admin-route-active .media-library-card,
body.admin-route-active .media-library-card.media-studio-card,
body.dark.admin-route-active .media-library-card.media-studio-card {
  background: linear-gradient(135deg, #ffffff 0%, #f3f8ff 55%, #eaf3ff 100%) !important;
  color: #0b1b35 !important;
  border: 1px solid rgba(10, 88, 202, .22) !important;
  box-shadow: 0 22px 54px rgba(2, 18, 43, .18) !important;
}
body.admin-route-active .media-library-card.media-studio-card {
  grid-template-columns: minmax(148px, 178px) minmax(0, 1fr) !important;
  gap: 16px !important;
  align-items: center !important;
  min-height: 212px !important;
}
body.admin-route-active .media-library-card .media-card-body,
body.admin-route-active .media-library-card .media-card-title-row {
  min-width: 0 !important;
}
body.admin-route-active .media-library-card b,
body.admin-route-active .media-library-card strong,
body.admin-route-active .media-library-card .media-card-body b,
body.admin-route-active .media-library-card .media-card-title-row b,
body.dark.admin-route-active .media-library-card b {
  color: #0b1b35 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
body.admin-route-active .media-library-card small,
body.admin-route-active .media-library-card .media-card-body small,
body.dark.admin-route-active .media-library-card small {
  color: #475569 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
body.admin-route-active .media-library-card .media-type-pill {
  background: #dbeafe !important;
  color: #064ba7 !important;
  border: 1px solid rgba(10, 88, 202, .20) !important;
  text-shadow: none !important;
}
body.admin-route-active .media-library-card input {
  background: #ffffff !important;
  color: #07172e !important;
  border: 1px solid rgba(10, 88, 202, .26) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.68) !important;
}
body.admin-route-active .media-library-card .media-studio-thumb-button {
  min-width: 148px !important;
}
body.admin-route-active .media-library-card .media-thumb,
body.admin-route-active .media-library-card .media-thumb-stage {
  width: 100% !important;
  min-width: 148px !important;
  min-height: 148px !important;
  aspect-ratio: 1 / 1 !important;
  border-radius: 20px !important;
}
body.admin-route-active .media-library-card .media-thumb-stage img,
body.admin-route-active .media-library-card .media-thumb img {
  object-fit: contain !important;
  max-height: none !important;
}
body.admin-route-active .media-library-card .media-card-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
}
body.admin-route-active .media-library-card .media-action-btn,
body.admin-route-active .media-library-card .actions .btn.secondary {
  background: #102a4d !important;
  color: #ffffff !important;
  border-color: rgba(16, 42, 77, .72) !important;
  box-shadow: 0 12px 26px rgba(2, 18, 43, .22) !important;
}
body.admin-route-active .media-library-card .media-action-btn:hover,
body.admin-route-active .media-library-card .actions .btn.secondary:hover {
  background: #0b62d8 !important;
  color: #ffffff !important;
}
@media (max-width: 620px) {
  body.admin-route-active .media-library-card.media-studio-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.admin-route-active .media-library-card .media-studio-thumb-button,
  body.admin-route-active .media-library-card .media-thumb,
  body.admin-route-active .media-library-card .media-thumb-stage {
    min-width: 0 !important;
    min-height: 190px !important;
  }
}

body.admin-route-active .media-governance-panels .table-wrap.compact,
body.admin-route-active .duplicate-group-list {
  scrollbar-gutter: stable both-edges;
}
body.admin-route-active .duplicate-media-row {
  grid-template-columns: 92px minmax(0, 1fr) !important;
  align-items: flex-start !important;
}
body.admin-route-active .duplicate-media-row > span {
  display: block !important;
  width: 92px !important;
}
body.admin-route-active .media-thumb.small,
body.admin-route-active .media-thumb-stage.small {
  width: 84px !important;
  height: 84px !important;
  min-width: 84px !important;
  min-height: 84px !important;
  border-radius: 18px !important;
}
body.admin-route-active .duplicate-media-row small,
body.admin-route-active .media-governance-panels .admin-table small,
body.admin-route-active .media-governance-table small {
  display: block !important;
  color: var(--waha-admin-muted) !important;
  line-height: 1.55 !important;
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}
body.admin-route-active .media-governance-panels .admin-table th:nth-child(1),
body.admin-route-active .media-governance-panels .admin-table td:nth-child(1) {
  width: 128px !important;
  min-width: 128px !important;
}
body.admin-route-active .media-governance-panels .admin-table th:nth-child(2),
body.admin-route-active .media-governance-panels .admin-table td:nth-child(2) {
  min-width: 320px !important;
}
body.admin-route-active .media-governance-panels .admin-table th:nth-child(3),
body.admin-route-active .media-governance-panels .admin-table td:nth-child(3) {
  min-width: 180px !important;
}
body.admin-route-active .media-governance-panels .admin-table td:nth-child(4) {
  min-width: 180px !important;
}

body.admin-route-active .admin-table td,
body.admin-route-active .admin-table td b,
body.admin-route-active .admin-table td strong {
  color: var(--waha-admin-text) !important;
}
body.admin-route-active .admin-table .status-pill.bad {
  color: #fee2e2 !important;
}
body.admin-route-active .admin-table .status-pill.warn {
  color: #fde68a !important;
}
body.admin-route-active .admin-table .status-pill.good {
  color: #dcfce7 !important;
}
body.admin-route-active .admin-table .status-pill.muted,
body.admin-route-active .admin-table .usage-chip {
  color: #dbeafe !important;
}

@media (max-width: 980px) {
  body.admin-route-active .media-governance-panels .admin-table th:nth-child(2),
  body.admin-route-active .media-governance-panels .admin-table td:nth-child(2) {
    min-width: 260px !important;
  }
}

/* V21.41.6 — Legal Security rich-content studio and System Health command panel polish. */
body.admin-route-active .legal-security-card,
body.dark.admin-route-active .legal-security-card {
  background: linear-gradient(145deg, rgba(20, 43, 76, .98), rgba(8, 26, 50, .99)) !important;
  border: 1px solid rgba(139, 196, 255, .22) !important;
  box-shadow: 0 28px 80px rgba(0, 0, 0, .24) !important;
}
body.admin-route-active .legal-security-intro {
  padding: 18px 20px;
  border: 1px solid rgba(139, 196, 255, .18);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(10, 88, 202, .18), rgba(15, 35, 65, .42));
  margin-bottom: 18px;
}
body.admin-route-active .legal-security-intro h2,
body.admin-route-active .legal-security-intro p { margin-bottom: 6px !important; }
body.admin-route-active .rich-field-pro {
  margin: 18px 0 26px !important;
  border: 1px solid rgba(139, 196, 255, .22) !important;
  border-radius: 24px !important;
  background: linear-gradient(180deg, rgba(13, 39, 70, .96), rgba(8, 26, 50, .98)) !important;
  overflow: hidden !important;
  box-shadow: 0 18px 48px rgba(1, 12, 28, .22) !important;
}
body.admin-route-active .rich-field-pro .rich-label {
  padding: 16px 20px 8px !important;
  color: #ffffff !important;
  font-size: 1.02rem !important;
  font-weight: 900 !important;
  letter-spacing: .02em !important;
}
body.admin-route-active .rich-field-pro .rich-toolbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 3 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  padding: 12px 14px !important;
  background: linear-gradient(180deg, #233d60, #152f52) !important;
  border-top: 1px solid rgba(139, 196, 255, .16) !important;
  border-bottom: 1px solid rgba(139, 196, 255, .22) !important;
}
body.admin-route-active .rich-field-pro .rich-toolbar button {
  min-height: 38px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, .10) !important;
  color: #f8fbff !important;
  border: 1px solid rgba(219, 234, 254, .22) !important;
  font-weight: 800 !important;
}
body.admin-route-active .legal-security-form .rich-editor {
  min-height: 360px !important;
  max-height: min(66vh, 760px) !important;
  overflow: auto !important;
  padding: 34px 38px !important;
  line-height: 1.82 !important;
  font-size: 1.01rem !important;
  color: #12243d !important;
  background:
    linear-gradient(90deg, rgba(10, 88, 202, .055) 0 1px, transparent 1px) 0 0 / 42px 42px,
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: none !important;
}
body.admin-route-active .legal-security-form .rich-editor:focus {
  box-shadow: inset 0 0 0 3px rgba(10, 88, 202, .34) !important;
}
body.admin-route-active .legal-security-form .rich-editor h1,
body.admin-route-active .legal-security-form .rich-editor h2,
body.admin-route-active .legal-security-form .rich-editor h3,
body.admin-route-active .legal-security-form .rich-editor h4 {
  color: #072a5a !important;
  line-height: 1.2 !important;
  margin: 1.15em 0 .45em !important;
  font-weight: 900 !important;
  letter-spacing: -.02em !important;
}
body.admin-route-active .legal-security-form .rich-editor h1 {
  font-size: clamp(2rem, 3vw, 3rem) !important;
  padding-bottom: .32em !important;
  border-bottom: 3px solid #0a58ca !important;
}
body.admin-route-active .legal-security-form .rich-editor h2 {
  font-size: clamp(1.55rem, 2.2vw, 2.25rem) !important;
  padding: .35em .6em !important;
  background: linear-gradient(90deg, rgba(10, 88, 202, .12), rgba(10, 88, 202, .02)) !important;
  border-inline-start: 5px solid #0a58ca !important;
  border-radius: 14px !important;
}
body.admin-route-active .legal-security-form .rich-editor h3 {
  font-size: clamp(1.2rem, 1.6vw, 1.55rem) !important;
  color: #0a58ca !important;
  padding-inline-start: .7em !important;
  border-inline-start: 4px solid rgba(10, 88, 202, .42) !important;
}
body.admin-route-active .legal-security-form .rich-editor p,
body.admin-route-active .legal-security-form .rich-editor li {
  color: #1f324a !important;
  margin: .75em 0 !important;
}
body.admin-route-active .legal-security-form .rich-editor ul,
body.admin-route-active .legal-security-form .rich-editor ol { padding-inline-start: 1.55rem !important; }
body.admin-route-active .legal-security-form .rich-editor blockquote {
  margin: 1.2rem 0 !important;
  padding: 1rem 1.2rem !important;
  border-inline-start: 5px solid #0a58ca !important;
  background: #eef6ff !important;
  color: #12243d !important;
  border-radius: 16px !important;
}
body.admin-route-active .legal-security-form .rich-editor table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 1rem 0 !important;
  overflow: hidden !important;
  border-radius: 14px !important;
}
body.admin-route-active .legal-security-form .rich-editor th {
  background: #0a58ca !important;
  color: #ffffff !important;
}
body.admin-route-active .legal-security-form .rich-editor th,
body.admin-route-active .legal-security-form .rich-editor td {
  border: 1px solid rgba(10, 88, 202, .20) !important;
  padding: .75rem .9rem !important;
}
body.admin-route-active .legal-security-form .rich-help {
  padding: 12px 18px 16px !important;
  margin: 0 !important;
  color: #cfe4ff !important;
  background: rgba(8, 26, 50, .72) !important;
  border-top: 1px solid rgba(139, 196, 255, .16) !important;
}
body.admin-route-active .system-health-command-card,
body.dark.admin-route-active .system-health-command-card,
body.admin-route-active .system-health-policy-card,
body.dark.admin-route-active .system-health-policy-card {
  background: linear-gradient(145deg, rgba(15, 41, 74, .98), rgba(7, 22, 43, .99)) !important;
  border: 1px solid rgba(139, 196, 255, .23) !important;
  color: #f8fbff !important;
  box-shadow: 0 24px 64px rgba(0,0,0,.22) !important;
}
body.admin-route-active .system-health-command-card h2,
body.admin-route-active .system-health-policy-card h2 { color: #ffffff !important; }
body.admin-route-active .system-health-command-card .muted,
body.admin-route-active .system-health-policy-card .muted { color: #cfe4ff !important; }
body.admin-route-active .system-health-command-block,
body.admin-route-active pre.system-health-command-block {
  background: linear-gradient(135deg, #071426, #0b2342) !important;
  color: #e7f3ff !important;
  border: 1px solid rgba(139, 196, 255, .26) !important;
  border-radius: 18px !important;
  padding: 18px 20px !important;
  line-height: 1.85 !important;
  min-height: 164px !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 18px 40px rgba(0,0,0,.16) !important;
  white-space: pre-wrap !important;
}

/* V21.41.6 — Release blocker fix: legal rich editor readability and reliable formatting controls */
body.admin-route-active .legal-security-form .rich-field-pro {
  border: 1px solid rgba(139, 196, 255, .24) !important;
  background: linear-gradient(145deg, rgba(14, 38, 70, .98), rgba(7, 22, 43, .98)) !important;
  border-radius: 22px !important;
  overflow: hidden !important;
  box-shadow: 0 18px 42px rgba(1, 10, 26, .24) !important;
}
body.admin-route-active .rich-toolbar-pro {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
  padding: 12px 14px !important;
  background: linear-gradient(180deg, rgba(36, 63, 97, .98), rgba(25, 48, 80, .98)) !important;
  border-bottom: 1px solid rgba(139, 196, 255, .22) !important;
}
body.admin-route-active .rich-format-select {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  min-height: 38px !important;
  padding: 4px 8px 4px 10px !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, .12) !important;
  border: 1px solid rgba(219, 234, 254, .24) !important;
  color: #f8fbff !important;
  font-weight: 900 !important;
}
body.admin-route-active .rich-format-select span {
  color: #eaf4ff !important;
  font-size: .82rem !important;
  letter-spacing: .03em !important;
  text-transform: uppercase !important;
}
body.admin-route-active .rich-format-select select {
  min-width: 150px !important;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 9px !important;
  padding: 8px 28px 8px 10px !important;
  background: #f8fbff !important;
  color: #0b1b35 !important;
  font-weight: 850 !important;
  cursor: pointer !important;
}
body.admin-route-active .rich-toolbar-pro button[aria-pressed="true"] {
  background: #eaf4ff !important;
  color: #07428c !important;
  border-color: rgba(139, 196, 255, .75) !important;
}
body.admin-route-active .legal-security-form .rich-editor,
body.admin-route-active .legal-security-form .rich-editor-pro {
  min-height: 420px !important;
  max-height: min(70vh, 820px) !important;
  width: 100% !important;
  overflow: auto !important;
  padding: 38px 42px !important;
  background:
    linear-gradient(90deg, rgba(10, 88, 202, .035) 0 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%) !important;
  color: #10233d !important;
  -webkit-text-fill-color: #10233d !important;
  caret-color: #0a58ca !important;
  line-height: 1.86 !important;
  font-size: 1.02rem !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: inset 0 0 0 1px rgba(10, 88, 202, .16) !important;
  text-shadow: none !important;
  opacity: 1 !important;
}
body.admin-route-active .legal-security-form .rich-editor::selection,
body.admin-route-active .legal-security-form .rich-editor *::selection {
  background: #0a58ca !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
body.admin-route-active .legal-security-form .rich-editor h1,
body.admin-route-active .legal-security-form .rich-editor h1 *,
body.admin-route-active .legal-security-form .rich-editor h2,
body.admin-route-active .legal-security-form .rich-editor h2 *,
body.admin-route-active .legal-security-form .rich-editor h3,
body.admin-route-active .legal-security-form .rich-editor h3 *,
body.admin-route-active .legal-security-form .rich-editor h4,
body.admin-route-active .legal-security-form .rich-editor h4 * {
  opacity: 1 !important;
  text-shadow: none !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  background-color: transparent !important;
  -webkit-text-fill-color: currentColor !important;
}
body.admin-route-active .legal-security-form .rich-editor h1,
body.admin-route-active .legal-security-form .rich-editor h1 * {
  color: #062f6b !important;
  -webkit-text-fill-color: #062f6b !important;
}
body.admin-route-active .legal-security-form .rich-editor h2,
body.admin-route-active .legal-security-form .rich-editor h2 * {
  color: #073a7f !important;
  -webkit-text-fill-color: #073a7f !important;
}
body.admin-route-active .legal-security-form .rich-editor h3,
body.admin-route-active .legal-security-form .rich-editor h3 * {
  color: #0a58ca !important;
  -webkit-text-fill-color: #0a58ca !important;
}
body.admin-route-active .legal-security-form .rich-editor p,
body.admin-route-active .legal-security-form .rich-editor p *,
body.admin-route-active .legal-security-form .rich-editor li,
body.admin-route-active .legal-security-form .rich-editor li *,
body.admin-route-active .legal-security-form .rich-editor div,
body.admin-route-active .legal-security-form .rich-editor div *,
body.admin-route-active .legal-security-form .rich-editor span,
body.admin-route-active .legal-security-form .rich-editor strong,
body.admin-route-active .legal-security-form .rich-editor em {
  color: #1c3048 !important;
  -webkit-text-fill-color: #1c3048 !important;
  opacity: 1 !important;
  text-shadow: none !important;
}
body.admin-route-active .legal-security-form .rich-editor h1 {
  font-size: clamp(2rem, 3vw, 3.05rem) !important;
  margin: 1rem 0 .65rem !important;
  padding-bottom: .34em !important;
  border-bottom: 3px solid rgba(10, 88, 202, .75) !important;
}
body.admin-route-active .legal-security-form .rich-editor h2 {
  font-size: clamp(1.48rem, 2vw, 2.15rem) !important;
  margin: 1.25rem 0 .55rem !important;
  padding: .46em .72em !important;
  background: linear-gradient(90deg, rgba(10, 88, 202, .14), rgba(10, 88, 202, .025)) !important;
  border-inline-start: 5px solid #0a58ca !important;
  border-radius: 15px !important;
}
body.admin-route-active .legal-security-form .rich-editor h3 {
  font-size: clamp(1.18rem, 1.55vw, 1.5rem) !important;
  margin: 1.05rem 0 .48rem !important;
  padding-inline-start: .78em !important;
  border-inline-start: 4px solid rgba(10, 88, 202, .48) !important;
}
body.admin-route-active .legal-security-form .rich-editor a,
body.admin-route-active .legal-security-form .rich-editor a * {
  color: #064fb1 !important;
  -webkit-text-fill-color: #064fb1 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}
body.admin-route-active .legal-security-form .rich-editor blockquote,
body.admin-route-active .legal-security-form .rich-editor blockquote * {
  color: #12243d !important;
  -webkit-text-fill-color: #12243d !important;
  background: #eef6ff !important;
}
body.admin-route-active .legal-security-form .rich-editor img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 28px rgba(8, 36, 76, .14) !important;
}
body.admin-route-active .legal-security-form .rich-help {
  font-size: .93rem !important;
  line-height: 1.55 !important;
  color: #d8eaff !important;
}
@media (max-width: 760px) {
  body.admin-route-active .legal-security-form .rich-editor,
  body.admin-route-active .legal-security-form .rich-editor-pro { padding: 26px 22px !important; }
  body.admin-route-active .rich-format-select { width: 100% !important; justify-content: space-between !important; }
  body.admin-route-active .rich-format-select select { flex: 1 1 auto !important; min-width: 0 !important; }
}
