/* ==========================================================================
   ConsentHub — brand & application layer
   Built on top of the "Geex" admin theme (assets/css/style.css).
   This file only adds: brand marks, app components and small overrides.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (aligned with the Geex palette)
   -------------------------------------------------------------------------- */
:root {
  --ch-radius: 24px;
  --ch-radius-sm: 14px;
  --ch-radius-xs: 10px;

  --ch-border: #eceaf3;
  --ch-surface: #ffffff;
  --ch-surface-2: #f8f7fb;
  --ch-surface-3: #f3f2f7;
  --ch-text: #17161e;
  --ch-muted: #8a879b;
  --ch-shadow: 0 12px 30px rgba(23, 22, 30, 0.06);

  --ch-primary: var(--primary-color, #ab54db);
  --ch-primary-dark: #7f34a8;
  --ch-success: var(--success-color, #00a389);
  --ch-warning: #f0a02c;
  --ch-danger: var(--danger-color, #ff5b5b);
  --ch-info: var(--info-color, #58cdff);

  --ch-primary-soft: rgba(171, 84, 219, 0.12);
  --ch-success-soft: rgba(0, 163, 137, 0.12);
  --ch-warning-soft: rgba(255, 187, 84, 0.2);
  --ch-danger-soft: rgba(255, 91, 91, 0.12);
  --ch-info-soft: rgba(88, 205, 255, 0.14);
}

html[data-theme="dark"] {
  --ch-border: #332f3f;
  --ch-surface: #241f2e;
  --ch-surface-2: #2b2637;
  --ch-surface-3: #201c29;
  --ch-text: #f4f3f8;
  --ch-muted: #9d99ab;
  --ch-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* --------------------------------------------------------------------------
   2. Brand
   -------------------------------------------------------------------------- */
.ch-brand {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;
}

.ch-brand__mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--ch-primary) 0%, #7c3aed 100%);
  box-shadow: 0 8px 18px rgba(171, 84, 219, 0.35);
  flex: 0 0 auto;
}

.ch-brand__text {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--body-color);
  line-height: 1;
}

.ch-brand__text span {
  color: var(--ch-primary);
}

html[data-theme="dark"] .ch-brand__text {
  color: #fff;
}

/* --------------------------------------------------------------------------
   3. Sidebar
   -------------------------------------------------------------------------- */
.ch-sidebar__section {
  margin: 6px 0 10px;
  padding: 0 12px;
}

.ch-sidebar__label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ch-muted);
}

.geex-sidebar__menu__link {
  cursor: pointer;
}

.geex-sidebar__menu__link .ch-nav-badge {
  margin-inline-start: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  border-radius: 7px;
  color: #fff;
  background: var(--ch-primary);
}

.geex-sidebar__menu__link .ch-nav-badge--danger {
  background: var(--ch-danger);
}

.geex-sidebar__menu__link .ch-nav-badge--warning {
  background: var(--ch-warning);
}

.ch-sidebar-footer {
  padding: 0 22px 26px;
}

.ch-sidebar-user {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 6px 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-sidebar-user small {
  font-size: 12px;
  font-weight: 600;
  color: var(--ch-muted);
}

/* --------------------------------------------------------------------------
   4. Layout helpers
   -------------------------------------------------------------------------- */
.ch-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
}

.ch-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
}

.ch-grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.ch-grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.ch-stack {
  display: grid;
  gap: 18px;
}

.ch-mb-24 {
  margin-bottom: 24px;
}

.ch-mt-24 {
  margin-top: 24px;
}

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

.ch-spacer {
  flex: 1;
}

.ch-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--ch-text);
  margin: 0 0 4px;
}

.ch-section-sub {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--ch-muted);
}

.geex-content__section {
  border: 1px solid var(--ch-border);
  box-shadow: var(--ch-shadow);
}

.geex-content__section__header__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-sub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  color: var(--ch-muted);
}

.ch-card-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
}

.ch-muted {
  color: var(--ch-muted) !important;
}

.ch-card--narrow {
  max-width: 620px;
}

/* --------------------------------------------------------------------------
   5. Stat (KPI) cards
   -------------------------------------------------------------------------- */
.ch-stat {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border-radius: var(--ch-radius);
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  box-shadow: var(--ch-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ch-stat:hover {
  transform: translateY(-3px);
}

.ch-stat__icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 20px;
  color: var(--ch-primary);
  background: var(--ch-primary-soft);
}

.ch-stat__icon--success {
  color: var(--ch-success);
  background: var(--ch-success-soft);
}
.ch-stat__icon--warning {
  color: var(--ch-warning);
  background: var(--ch-warning-soft);
}
.ch-stat__icon--danger {
  color: var(--ch-danger);
  background: var(--ch-danger-soft);
}
.ch-stat__icon--info {
  color: var(--ch-info);
  background: var(--ch-info-soft);
}

.ch-stat__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ch-muted);
}

.ch-stat__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ch-text);
}

.ch-stat__delta {
  font-size: 12.5px;
  color: var(--ch-muted);
}

.ch-stat__delta--up {
  color: var(--ch-success);
  font-weight: 600;
}

.ch-stat__delta--down {
  color: var(--ch-danger);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   6. Badges, chips, kv rows
   -------------------------------------------------------------------------- */
.ch-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
  border-radius: 8px;
  white-space: nowrap;
  background: var(--ch-surface-3);
  color: var(--ch-muted);
  text-transform: capitalize;
}

.ch-badge--active,
.ch-badge--granted,
.ch-badge--resolved,
.ch-badge--healthy {
  background: var(--ch-success-soft);
  color: var(--ch-success);
}

.ch-badge--withdrawn,
.ch-badge--escalated {
  background: var(--ch-danger-soft);
  color: var(--ch-danger);
}

.ch-badge--expired,
.ch-badge--requested,
.ch-badge--pending {
  background: var(--ch-warning-soft);
  color: #b5781a;
}

.ch-badge--inprogress {
  background: var(--ch-primary-soft);
  color: var(--ch-primary-dark);
}

.ch-badge--info {
  background: var(--ch-info-soft);
  color: #1f8ab8;
}

.ch-badge--rule {
  background: var(--ch-surface-3);
  color: var(--ch-muted);
  text-transform: none;
}

.ch-badge--regulatory {
  background: var(--ch-info-soft);
  color: #1f8ab8;
}
.ch-badge--marketing {
  background: var(--ch-warning-soft);
  color: #b5781a;
}
.ch-badge--analytics {
  background: var(--ch-primary-soft);
  color: var(--ch-primary-dark);
}
.ch-badge--legitimate {
  background: var(--ch-success-soft);
  color: var(--ch-success);
}

.ch-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  margin: 3px 4px 3px 0;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--ch-surface-3);
  color: var(--ch-muted);
  border: 1px solid transparent;
}

html[data-theme="dark"] .ch-chip {
  background: rgba(255, 255, 255, 0.06);
}

.ch-chip--warn {
  background: var(--ch-warning-soft);
  color: #b5781a;
}

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

.ch-kv {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 13px;
  color: var(--ch-muted);
  margin-top: 8px;
}

.ch-kv b {
  color: var(--ch-text);
}

.ch-note {
  display: block;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.7;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-primary-soft);
  color: var(--ch-text);
}

.ch-note--warning {
  background: var(--ch-warning-soft);
}

/* --------------------------------------------------------------------------
   7. Buttons
   -------------------------------------------------------------------------- */
.geex-btn {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.geex-btn--sm {
  padding: 10px 16px;
  font-size: 13px;
  border-radius: 12px;
}

.geex-btn--primary {
  color: #fff;
  background: var(--ch-primary);
}

.geex-btn--primary:hover {
  color: #fff;
  background: var(--ch-primary-dark);
}

.geex-btn--success {
  color: #fff;
  background: var(--ch-success);
}

.geex-btn--danger {
  color: #fff;
  background: var(--ch-danger);
}

.geex-btn--danger:hover {
  color: #fff;
  filter: brightness(0.94);
}

.geex-btn--danger-transparent {
  color: var(--ch-danger);
  background: var(--ch-danger-soft);
}

.geex-btn--outline {
  background: transparent;
  border: 1px solid var(--ch-border);
  color: var(--ch-text);
}

.geex-btn--outline:hover {
  border-color: var(--ch-primary);
  color: var(--ch-primary);
}

.geex-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ch-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* --------------------------------------------------------------------------
   8. Tables
   -------------------------------------------------------------------------- */
.ch-table-wrap {
  overflow-x: auto;
  border-radius: var(--ch-radius-sm);
}

.ch-table-wrap table {
  min-width: 100%;
}

.table-reviews-geex-1 thead tr th {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 16px 16px;
  border-bottom: 1px solid var(--ch-border);
}

.table-reviews-geex-1 tbody tr td {
  padding: 16px 16px;
  font-size: 13.5px;
  color: var(--ch-text);
  vertical-align: middle;
}

.table-reviews-geex-1 tbody tr:hover {
  background: var(--ch-surface-2);
}

html[data-theme="dark"] .table-reviews-geex-1,
html[data-theme="dark"] .table-reviews-geex-1 thead tr th {
  background: transparent;
}

.ch-hash {
  color: var(--ch-success);
  cursor: help;
}

/* --------------------------------------------------------------------------
   9. Consent cards
   -------------------------------------------------------------------------- */
.ch-consent {
  display: flex;
  gap: 16px;
  padding: 24px;
  border-radius: var(--ch-radius);
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  box-shadow: var(--ch-shadow);
}

.ch-consent__icon {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 24px;
  border-radius: 16px;
  background: var(--ch-surface-3);
}

.ch-consent__body {
  flex: 1;
  min-width: 0;
}

.ch-consent__head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ch-consent__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ch-text);
}

/* --------------------------------------------------------------------------
   10. Progress / bars / sparkline
   -------------------------------------------------------------------------- */
.ch-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 48px;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.ch-bar-row__label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ch-text);
}

.ch-bar-row__track {
  height: 10px;
  border-radius: 999px;
  background: var(--ch-surface-3);
  overflow: hidden;
}

html[data-theme="dark"] .ch-bar-row__track {
  background: rgba(255, 255, 255, 0.08);
}

.ch-bar-row__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--ch-primary);
  transition: width 0.6s ease;
}

.ch-bar-row__value {
  font-size: 13px;
  font-weight: 700;
  text-align: end;
  color: var(--ch-text);
}

.ch-spark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 120px;
  padding: 10px 0;
}

.ch-spark__bar {
  flex: 1;
  min-height: 6px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, var(--ch-primary) 0%, rgba(171, 84, 219, 0.35) 100%);
}

/* --------------------------------------------------------------------------
   11. Activity feed
   -------------------------------------------------------------------------- */
.ch-feed {
  display: flex;
  flex-direction: column;
}

.ch-feed__item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ch-border);
}

.ch-feed__item:last-child {
  border-bottom: 0;
}

.ch-feed__icon {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 16px;
  border-radius: 12px;
  background: var(--ch-surface-3);
}

.ch-feed__icon--success {
  background: var(--ch-success-soft);
}
.ch-feed__icon--danger {
  background: var(--ch-danger-soft);
}
.ch-feed__icon--primary {
  background: var(--ch-primary-soft);
}
.ch-feed__icon--warning {
  background: var(--ch-warning-soft);
}

.ch-feed__body {
  flex: 1;
  min-width: 0;
}

.ch-feed__action {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ch-text);
}

.ch-feed__meta {
  font-size: 12.5px;
  color: var(--ch-muted);
  margin-top: 2px;
}

.ch-feed__time {
  font-size: 12px;
  color: var(--ch-muted);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   12. Forms & switches
   -------------------------------------------------------------------------- */
.ch-field {
  margin-top: 16px;
}

.ch-field__label {
  display: block;
  margin-bottom: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ch-muted);
}

.ch-input,
.ch-select,
.ch-textarea {
  width: 100%;
  padding: 12px 16px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--ch-text);
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  border-radius: var(--ch-radius-sm);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ch-textarea {
  resize: vertical;
  min-height: 92px;
}

.ch-input:focus,
.ch-select:focus,
.ch-textarea:focus {
  border-color: var(--ch-primary);
  box-shadow: 0 0 0 3px var(--ch-primary-soft);
}

.ch-select--sm {
  padding: 9px 14px;
  font-size: 13px;
  border-radius: 10px;
}

.ch-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  font-size: 13.5px;
  color: var(--ch-text);
  cursor: pointer;
}

.ch-check input[type="checkbox"],
.ch-check input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--ch-primary);
  cursor: pointer;
}

.ch-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.ch-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.ch-switch__slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  border-radius: 999px;
  background: var(--ch-surface-3);
  transition: background 0.25s ease;
}

html[data-theme="dark"] .ch-switch__slider {
  background: rgba(255, 255, 255, 0.14);
}

.ch-switch__slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  inset-inline-start: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease;
}

.ch-switch input:checked + .ch-switch__slider {
  background: var(--ch-primary);
}

.ch-switch input:checked + .ch-switch__slider::before {
  transform: translateX(20px);
}

html[dir="rtl"] .ch-switch input:checked + .ch-switch__slider::before {
  transform: translateX(-20px);
}

.ch-switch input:disabled + .ch-switch__slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.ch-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--ch-border);
}

.ch-toggle-row:last-child {
  border-bottom: 0;
}

.ch-toggle-row__label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ch-text);
}

/* --------------------------------------------------------------------------
   13. Tabs
   -------------------------------------------------------------------------- */
.ch-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px;
  margin-bottom: 22px;
  border-radius: 16px;
  background: var(--ch-surface-3);
}

html[data-theme="dark"] .ch-tabs {
  background: rgba(255, 255, 255, 0.06);
}

.ch-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  color: var(--ch-muted);
  background: transparent;
  border: 0;
  transition: all 0.2s ease;
}

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

.ch-tab.is-active {
  color: #fff;
  background: var(--ch-primary);
  box-shadow: 0 8px 16px rgba(171, 84, 219, 0.28);
}

/* --------------------------------------------------------------------------
   14. Hero (demo hub)
   -------------------------------------------------------------------------- */
.ch-hero {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: var(--ch-radius);
  color: #fff;
  background: linear-gradient(135deg, #7c3aed 0%, #ab54db 55%, #d478ff 100%);
  box-shadow: 0 20px 44px rgba(124, 58, 237, 0.28);
}

.ch-hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  inset-inline-end: -140px;
  top: -160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.ch-hero h1 {
  position: relative;
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
}

.ch-hero p {
  position: relative;
  max-width: 760px;
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.9);
}

.ch-hero__flag {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.ch-persona-card {
  position: relative;
  display: block;
  padding: 28px;
  border-radius: var(--ch-radius);
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  box-shadow: var(--ch-shadow);
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.ch-persona-card:hover {
  transform: translateY(-4px);
  border-color: var(--ch-primary);
  box-shadow: 0 18px 40px rgba(171, 84, 219, 0.16);
}

.ch-persona-card__icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 26px;
  border-radius: 18px;
  margin-bottom: 16px;
  background: var(--ch-primary-soft);
}

.ch-persona-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-persona-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ch-muted);
}

.ch-persona-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ch-primary);
}

/* --------------------------------------------------------------------------
   15. Notice preview
   -------------------------------------------------------------------------- */
.ch-notice {
  padding: 22px;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-surface-2);
  border: 1px solid var(--ch-border);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--ch-text);
}

.ch-notice h5 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-notice ul {
  margin: 8px 0;
  padding-inline-start: 20px;
}

.ch-notice p {
  margin: 10px 0;
}

.ch-notice__meta {
  font-size: 11.5px;
  color: var(--ch-muted);
  margin-bottom: 10px;
}

.ch-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-primary-soft);
  color: var(--ch-text);
}

.ch-banner--muted {
  background: var(--ch-surface-3);
  color: var(--ch-muted);
}

.ch-banner .geex-btn {
  margin-inline-start: auto;
}

/* --------------------------------------------------------------------------
   16. Connectors / integration tiles
   -------------------------------------------------------------------------- */
.ch-connector {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
}

.ch-connector__logo {
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 22px;
  border-radius: 14px;
  background: var(--ch-surface-3);
}

.ch-connector__info {
  flex: 1;
  min-width: 0;
}

.ch-connector__name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-connector__desc {
  font-size: 12.5px;
  color: var(--ch-muted);
  margin-top: 2px;
}

.ch-code {
  padding: 18px;
  border-radius: var(--ch-radius-sm);
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  color: #e9e4f5;
  background: #1c1826;
}

.ch-code .ch-code__ok {
  color: #7ef0c9;
}

.ch-code .ch-code__warn {
  color: #ffd08a;
}

/* --------------------------------------------------------------------------
   17. Breach / callouts
   -------------------------------------------------------------------------- */
.ch-callout {
  padding: 26px;
  border-radius: var(--ch-radius);
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  border-inline-start: 4px solid var(--ch-danger);
  box-shadow: var(--ch-shadow);
}

.ch-callout__head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ch-deadline {
  font-weight: 700;
  color: var(--ch-danger);
}

.ch-empty {
  padding: 40px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--ch-muted);
  border-radius: var(--ch-radius-sm);
  border: 1px dashed var(--ch-border);
}

/* --------------------------------------------------------------------------
   18. Modal
   -------------------------------------------------------------------------- */
.ch-modal-root {
  position: relative;
  z-index: 1050;
}

.ch-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 22, 30, 0.55);
  backdrop-filter: blur(3px);
  animation: ch-fade 0.2s ease;
}

.ch-modal {
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 28px;
  border-radius: var(--ch-radius);
  background: var(--ch-surface);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35);
  animation: ch-pop 0.22s ease;
}

.ch-modal h3 {
  margin: 0 0 10px;
  font-size: 19px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-modal p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ch-muted);
}

.ch-modal__footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.ch-progress {
  height: 10px;
  margin-top: 18px;
  border-radius: 999px;
  background: var(--ch-surface-3);
  overflow: hidden;
}

.ch-progress__bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--ch-primary);
  transition: width 0.25s ease;
}

@keyframes ch-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes ch-pop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   19. Toasts
   -------------------------------------------------------------------------- */
.ch-toasts {
  position: fixed;
  inset-inline-end: 26px;
  bottom: 26px;
  z-index: 1060;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 380px;
}

.ch-toast {
  padding: 14px 18px;
  font-size: 13px;
  line-height: 1.6;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  border-inline-start: 4px solid var(--ch-primary);
  box-shadow: 0 18px 40px rgba(23, 22, 30, 0.18);
  animation: ch-slide 0.28s ease;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ch-toast__title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-toast__body {
  margin-top: 3px;
  color: var(--ch-muted);
}

.ch-toast code {
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11.5px;
  background: var(--ch-surface-3);
  color: var(--ch-primary-dark);
}

.ch-toast--green {
  border-inline-start-color: var(--ch-success);
}
.ch-toast--red {
  border-inline-start-color: var(--ch-danger);
}
.ch-toast--amber {
  border-inline-start-color: var(--ch-warning);
}
.ch-toast--blue {
  border-inline-start-color: var(--ch-info);
}

@keyframes ch-slide {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   20. Header helpers
   -------------------------------------------------------------------------- */
.ch-qi {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 17px;
  background: var(--ch-surface-3);
  color: var(--ch-muted);
}

.ch-qi--primary {
  background: var(--ch-primary-soft);
  color: var(--ch-primary);
}
.ch-qi--danger {
  background: var(--ch-danger-soft);
  color: var(--ch-danger);
}
.ch-qi--warning {
  background: var(--ch-warning-soft);
  color: var(--ch-warning);
}

.ch-user {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ch-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 700;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--ch-primary) 0%, #7c3aed 100%);
}

.ch-user__meta {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.ch-user__meta b {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-user__meta i {
  font-size: 11.5px;
  font-style: normal;
  color: var(--ch-muted);
}

.geex-content__header__popup--lang,
.geex-content__header__popup--user {
  padding: 20px;
}

.ch-signed-in {
  margin: 0 0 8px;
  font-size: 12.5px;
  color: var(--ch-muted);
}

.ch-signed-in b {
  color: var(--ch-text);
}

.ch-workspace {
  margin: 0;
  font-size: 12.5px;
  color: var(--ch-muted);
}

.ch-workspace b {
  color: var(--ch-text);
}

.ch-account__note {
  margin: 12px 0 0;
  padding-top: 12px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ch-muted);
  border-top: 1px solid var(--ch-border);
}

.geex-content__header__popup__footer__link#ch-signout {
  cursor: pointer;
  color: var(--ch-danger);
}

.geex-content__header__popup__footer__link#ch-signout:hover {
  color: var(--ch-danger);
  filter: brightness(0.92);
}

.ch-customizer__note {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ch-muted);
}

/* --------------------------------------------------------------------------
   21. Responsive
   -------------------------------------------------------------------------- */@media (max-width: 991px) {
  .ch-hero {
    padding: 28px;
  }

  .ch-hero h1 {
    font-size: 24px;
  }

  .ch-bar-row {
    grid-template-columns: 100px 1fr 44px;
  }

  .ch-toasts {
    inset-inline: 16px;
    max-width: none;
  }

  .ch-user__meta {
    display: none;
  }
}

@media (max-width: 575px) {
  .ch-consent {
    flex-direction: column;
  }

  .ch-connector {
    flex-wrap: wrap;
  }
}

/* --------------------------------------------------------------------------
   22. Authentication (login) page
   -------------------------------------------------------------------------- */
.authentication-page {
  background: var(--ch-surface-3);
}

/* The theme pins each auth column to 100vh and scrolls the form inside a
   nested container that hides its own scrollbar, which clips taller forms.
   Let the page scroll normally instead. */
.authentication-page .geex-content__authentication {
  align-items: stretch;
  min-height: 100vh;
}

.authentication-page .geex-content__authentication__content {
  height: auto;
  min-height: 100vh;
  padding: 56px 24px;
}

.authentication-page .geex-content__authentication__content__wrapper {
  max-height: none;
  overflow: visible;
}

.authentication-page .geex-content__authentication__img {
  height: auto;
  min-height: 100vh;
  padding: 56px 60px;
}

.ch-auth__logo {
  display: flex;
  justify-content: center;
  margin-bottom: 26px;
}

.ch-auth__logo .ch-brand__mark {
  width: 48px;
  height: 48px;
  border-radius: 15px;
}

.ch-auth__logo .ch-brand__text {
  font-size: 24px;
}

.ch-auth__lede {
  margin: -26px 0 30px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ch-muted);
}

/* Inline error banner */
.ch-auth__error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 16px;
  margin-bottom: 22px;
  font-size: 13px;
  line-height: 1.6;
  text-align: start;
  border-radius: var(--ch-radius-sm);
  color: #a32121;
  background: var(--ch-danger-soft);
  border: 1px solid rgba(255, 91, 91, 0.35);
}

.ch-auth__error i {
  font-size: 17px;
  line-height: 1.3;
  flex: 0 0 auto;
}

.ch-auth__error[hidden] {
  display: none;
}

html[data-theme="dark"] .ch-auth__error {
  color: #ffb8b8;
}

/* Autofill flash */
.ch-auth__filled {
  animation: ch-auth-flash 0.9s ease;
}

@keyframes ch-auth-flash {
  0% {
    border-color: var(--ch-primary);
    box-shadow: 0 0 0 4px var(--ch-primary-soft);
  }
  100% {
    border-color: var(--gray-color);
    box-shadow: none;
  }
}

.geex-content__authentication__label-wrapper .ch-auth__hint-link {
  color: var(--ch-muted);
  transition: color 0.2s ease;
}

.geex-content__authentication__label-wrapper .ch-auth__hint-link:hover {
  color: var(--ch-primary);
}

.geex-content__authentication__form-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--ch-primary);
  cursor: pointer;
}

.geex-content__authentication__form-submit:hover {
  background: var(--ch-primary-dark);
}

.geex-content__authentication__form-submit:disabled {
  opacity: 0.75;
  cursor: progress;
}

.geex-content__authentication__form-submit i {
  font-size: 18px;
}

/* The theme hides this checkbox with display:none, which also drops it from
   the keyboard tab order. Keep it visually hidden but focusable instead. */
.ch-auth__remember input[type="checkbox"] {
  display: block;
  position: absolute;
  inset-inline-start: 0;
  top: 3px;
  width: 16px;
  height: 16px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.ch-auth__remember input[type="checkbox"]:focus-visible + label:before {
  box-shadow: 0 0 0 3px var(--ch-primary-soft);
}

.ch-auth__remember .geex-content__authentication__checkbox-label {
  cursor: pointer;
}

/* ---------- Demo credentials ---------- */
.ch-auth__demo {
  margin-top: 6px;
  padding: 18px;
  text-align: start;
  border-radius: var(--ch-radius-sm);
  background: var(--ch-surface-3);
  border: 1px solid var(--ch-border);
}

html[data-theme="dark"] .ch-auth__demo {
  background: rgba(255, 255, 255, 0.04);
}

.ch-auth__demo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ch-auth__demo-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-auth__demo-head span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ch-muted);
}

.ch-auth__creds {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ch-auth__cred-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  text-align: start;
  cursor: pointer;
  border-radius: 14px;
  background: var(--ch-surface);
  border: 1px solid var(--ch-border);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ch-auth__cred-btn:hover,
.ch-auth__cred-btn.is-selected {
  border-color: var(--ch-primary);
  box-shadow: 0 8px 18px rgba(171, 84, 219, 0.14);
}

.ch-auth__cred-btn:hover {
  transform: translateY(-1px);
}

.ch-auth__cred-ic {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 17px;
  border-radius: 12px;
  color: var(--ch-primary);
  background: var(--ch-primary-soft);
}

.ch-auth__cred-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ch-auth__cred-body b {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ch-text);
}

.ch-auth__cred-body b em {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  color: var(--ch-muted);
  background: var(--ch-surface-3);
}

.ch-auth__cred-body small {
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ch-muted);
}

.ch-auth__cred-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.ch-auth__cred-keys code {
  padding: 2px 7px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  border-radius: 6px;
  color: var(--ch-primary-dark);
  background: var(--ch-primary-soft);
}

html[data-theme="dark"] .ch-auth__cred-keys code {
  color: #e5c2ff;
}

.ch-auth__cred-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 999px;
  color: var(--ch-primary);
  background: var(--ch-primary-soft);
}

.ch-auth__demo-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ch-muted);
}

.ch-auth__demo-note i {
  font-size: 14px;
  line-height: 1.5;
  flex: 0 0 auto;
}

/* ---------- Brand panel ---------- */
.ch-auth__side {
  background: linear-gradient(150deg, #2a1436 0%, #4c1d95 45%, #7c3aed 100%);
}

.ch-auth__side-inner {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
}

.ch-auth__side-inner img {
  width: 100%;
  max-width: 380px;
  margin: 8px auto 18px;
  display: block;
}

.ch-auth__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.26);
}

.ch-auth__side-inner h3 {
  margin: 0 0 12px;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
}

.ch-auth__side-inner p {
  margin: 0 0 22px;
  font-size: 13.5px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.82);
}

.ch-auth__facts {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: start;
}

.ch-auth__facts li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  font-size: 12.5px;
  line-height: 1.5;
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.1);
}

.ch-auth__facts li i {
  font-size: 17px;
  color: #e5c2ff;
  flex: 0 0 auto;
}

.ch-auth__facts li b {
  color: #fff;
}

@media (max-width: 1199px) {
  .authentication-page {
    background: var(--ch-surface);
  }

  .ch-auth__side {
    display: none;
  }
}

@media (max-width: 575px) {
  .ch-auth__cred-btn {
    flex-wrap: wrap;
  }

  .ch-auth__cred-cta {
    margin-inline-start: 52px;
  }

  .ch-auth__demo-head {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ==========================================================================
   23. Rule coverage screens
   Penalty exposure model, SDF tracker, transfer register, guardian consents
   and the Rule 21 escalation ladder. All colours come from the shared
   --ch-* tokens so dark mode needs no extra rules.
   ========================================================================== */

.ch-stat__icon--primary {
  color: var(--primary-color);
  background: var(--ch-primary-soft);
}

/* ---- 23.1 Modelled-outcome panel (penalty calculator) ---- */
.ch-total {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 22px;
  margin-bottom: 20px;
  border-radius: var(--ch-radius);
  border: 1px solid var(--ch-border);
  background: linear-gradient(135deg, var(--ch-primary-soft), transparent 85%);
}

.ch-total__label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ch-muted);
}

.ch-total__value {
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary-color);
}

.ch-total__meta {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ch-muted);
}

.ch-total__meta b {
  color: var(--ch-text);
}

/* ---- 23.2 Section 33(2) factor list ---- */
.ch-factor {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--ch-radius);
  border: 1px solid var(--ch-border);
  background: var(--ch-surface-2);
}

.ch-factor__num {
  flex: 0 0 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary-color);
  background: var(--ch-primary-soft);
}

.ch-factor b {
  display: block;
  font-size: 13px;
  color: var(--ch-text);
  margin-bottom: 3px;
}

.ch-factor small {
  display: block;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ch-muted);
}

/* ---- 23.3 Escalation / appeal ladder (Rule 21) ---- */
.ch-ladder {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.ch-ladder__step {
  position: relative;
  display: flex;
  gap: 14px;
  padding: 0 0 22px 0;
}

.ch-ladder__step:last-child {
  padding-bottom: 0;
}

.ch-ladder__step::before {
  content: "";
  position: absolute;
  inset-inline-start: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--ch-border);
}

.ch-ladder__step:last-child::before {
  display: none;
}

.ch-ladder__dot {
  position: relative;
  z-index: 1;
  flex: 0 0 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 14px;
  color: var(--ch-muted);
  background: var(--ch-surface-3);
  border: 1px solid var(--ch-border);
}

.ch-ladder__step.is-done .ch-ladder__dot {
  color: #fff;
  background: var(--success-color);
  border-color: var(--success-color);
}

.ch-ladder__step.is-current .ch-ladder__dot {
  color: #fff;
  background: var(--primary-color);
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--ch-primary-soft);
}

.ch-ladder__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

.ch-ladder__body b {
  font-size: 13.5px;
  color: var(--ch-text);
}

.ch-ladder__ref {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--primary-color);
}

.ch-ladder__body small {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ch-muted);
}

.ch-ladder--compact .ch-ladder__step {
  padding-bottom: 16px;
}

.ch-ladder--compact .ch-ladder__body small {
  display: none;
}

/* ---- 23.4 Flat check list rows (transfer safeguards) ---- */
.ch-check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--ch-border);
}

.ch-check-row:last-of-type {
  border-bottom: 0;
}

.ch-check-row .ch-feed__body {
  gap: 2px;
}

/* ---- 23.5 Guardian consent cards ---- */
.ch-consent .ch-badge,
.ch-consent .ch-chip {
  flex: 0 0 auto;
}

.ch-consent__body .ch-kv {
  margin-top: 10px;
}

/* ---- 23.6 Dense two-column demo panels ---- */
.ch-grid--2 > .geex-content__section,
.ch-grid--4 > .geex-content__section {
  margin-bottom: 0;
}

@media (max-width: 991px) {
  .ch-total__value {
    font-size: 28px;
  }

  .ch-ladder__step::before {
    inset-inline-start: 13px;
  }
}

@media (max-width: 575px) {
  .ch-factor {
    padding: 12px 13px;
  }

  .ch-total {
    padding: 16px;
  }
}
