:root {
  --chromatic-bg: rgba(40, 230, 111, 0.08);
  --chromatic-panel: rgba(40, 230, 111, 0.045);
  --chromatic-border: rgba(40, 230, 111, 0.20);
  --chromatic-muted: #5f6f65;
  --button-text: #071009;
  --black: #050806;
  --dark: #0b120e;
  --panel: #0d1511;
  --white: #ffffff;
  --muted: #a8b6ac;
  --line: rgba(255,255,255,.10);
  --green: #28e66f;
  --green-2: #0aa846;
  --green-soft: rgba(40, 230, 111, .14);
  --shadow: 0 24px 80px rgba(0,0,0,.35);
  --radius: 26px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--white);
  background:
    radial-gradient(circle at top right, rgba(40,230,111,.18), transparent 34rem),
    linear-gradient(135deg, #020302 0%, #071009 52%, #000 100%);
}

button, input, select, textarea { font: inherit; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 290px 1fr;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: rgba(5, 8, 6, .78);
  backdrop-filter: blur(18px);
  padding: 28px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 36px;
}
.brand h1, .brand p, .topbar h2, .topbar p { margin: 0; }
.brand h1 { font-size: 20px; }
.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #001b08;
  background: linear-gradient(135deg, var(--green), #baffd0);
  font-weight: 900;
  box-shadow: 0 14px 36px rgba(40,230,111,.25);
}

.eyebrow,
.brand p,
.sidebar-card p,
.hero-copy p,
.stat-card span,
.goal-card p,
.reward-card p,
.rules p,
.insights-grid p,
.performer-meta p,
.performer-score-caption { color: var(--muted); }

.nav { display: grid; gap: 8px; }
.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 13px 14px;
  border-radius: 14px;
  transition: .2s ease;
}
.nav a:hover,
.nav a.active {
  color: var(--white);
  background: var(--green-soft);
}

.sidebar-card, .content-card, .stat-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.045);
  box-shadow: 0 18px 60px rgba(0,0,0,.20);
}
.sidebar-card {
  margin-top: 36px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.03));
}
.sidebar-card h2 {
  margin: 8px 0;
  font-size: 42px;
}
.mini-progress {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  overflow: hidden;
}
.mini-progress span {
  display: block;
  height: 100%;
  background: var(--green);
}

.main { padding: 28px; }
.topbar, .section-header, .topbar-actions, .filters, .management-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar { margin-bottom: 24px; }
.topbar-spacer { min-height: 1px; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-weight: 700;
  font-size: 12px;
}

.primary-btn, .secondary-btn, .ghost-btn, .tab-btn {
  border: 0;
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 800;
}
.primary-btn {
  color: #001b08;
  background: var(--green);
  box-shadow: 0 14px 34px rgba(40,230,111,.18);
}
.ghost-btn {
  color: var(--white);
  background: transparent;
  border: 1px solid var(--line);
}
.secondary-btn {
  color: var(--white);
  background: rgba(255,255,255,.1);
}
.small {
  padding: 10px 13px;
  font-size: 14px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  min-height: 330px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(40,230,111,.16), rgba(255,255,255,.04)),
    rgba(255,255,255,.03);
  box-shadow: var(--shadow);
}

.pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  color: #001b08;
  background: #baffd0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}
.hero h3 {
  max-width: 880px;
  margin: 18px 0 14px;
  font-size: clamp(32px, 4vw, 58px);
  line-height: .98;
  letter-spacing: -0.05em;
}
.hero-copy p {
  max-width: 860px;
  font-size: 17px;
  line-height: 1.7;
}

.top-performers {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 2px);
  padding: 22px;
  background: linear-gradient(180deg, rgba(0,0,0,.18), rgba(255,255,255,.02));
}

.top-performers-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.top-performers-header p { margin: 0; }
.top-performers-header span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.top-performers-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.performer-card {
  position: relative;
  overflow: hidden;
  min-height: 470px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: calc(var(--radius) + 6px);
  padding: 28px;
  background:
    radial-gradient(circle at top left, rgba(40,230,111,.18), transparent 45%),
    linear-gradient(180deg, rgba(10,18,14,.92), rgba(2,6,4,.98));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.03);
}

.performer-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(40,230,111,.06), transparent 70%);
  pointer-events: none;
}

.performer-score-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 28px;
}

.performer-score-ring {
  width: 236px;
  height: 236px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 5px solid rgba(95,255,143,.35);
  outline: 24px solid rgba(81,220,118,.12);
  background: radial-gradient(circle, rgba(16,28,21,1) 0%, rgba(9,16,12,1) 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.03), 0 0 80px rgba(40,230,111,.10) inset;
}

.performer-score {
  text-align: center;
}
.performer-score strong {
  display: block;
  font-size: 78px;
  line-height: .9;
  letter-spacing: -0.06em;
}
.performer-score span {
  display: block;
  margin-top: 12px;
  font-size: 16px;
  color: #d6dbd7;
}

.performer-card-content {
  position: relative;
  z-index: 1;
}
.performer-label {
  margin: 0 0 20px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 13px;
  font-weight: 800;
  color: #d7ddda;
}
.performer-meta {
  display: flex;
  gap: 16px;
  align-items: center;
}
.performer-meta img {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  object-fit: cover;
  border: 2px solid rgba(95,255,143,.42);
}
.performer-meta strong {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}
.performer-meta p {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.45;
}
.rank-badge {
  position: absolute;
  top: 18px;
  right: 18px;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #001b08;
  background: var(--green);
  font-size: 14px;
  font-weight: 900;
  z-index: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 22px 0;
}
.stat-card { padding: 22px; }
.stat-card p, .stat-card h3 { margin: 0; }
.stat-card h3 {
  margin: 10px 0;
  font-size: 34px;
}
.content-card {
  padding: 24px;
  margin-bottom: 22px;
}

.filters input,
.filters select,
.upload-box input,
.upload-box select,
.journey-form textarea,
.journey-form select,
.reward-settings-form input,
.reward-settings-form select,
.editor-grid input,
.editor-grid textarea,
.editor-grid select,
.performer-editor-card input,
.performer-editor-card textarea {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}
.filters input:focus,
.filters select:focus,
.upload-box input:focus,
.upload-box select:focus,
.journey-form textarea:focus,
.journey-form select:focus,
.reward-settings-form input:focus,
.reward-settings-form select:focus,
.editor-grid input:focus,
.editor-grid textarea:focus,
.editor-grid select:focus,
.performer-editor-card input:focus,
.performer-editor-card textarea:focus {
  border-color: rgba(40,230,111,.7);
}

.table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}
table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}
th, td {
  text-align: left;
  padding: 16px 12px;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--muted);
  font-size: 13px;
}
.agent {
  display: flex;
  align-items: center;
  gap: 12px;
}
.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #001b08;
  background: var(--green);
  font-weight: 900;
}
.progress {
  width: 150px;
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  overflow: hidden;
}
.progress span {
  height: 100%;
  display: block;
  background: linear-gradient(90deg, var(--green-2), var(--green));
}
.badge {
  padding: 7px 10px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 12px;
}
.badge.Gold { color: #171100; background: #ffe38a; }
.badge.Silver { color: #111; background: #dfe6e2; }
.badge.Bronze { color: #210d00; background: #f5af75; }

.role-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 8px 12px;
  color: #001b08;
  background: #baffd0;
  font-weight: 900;
  font-size: 12px;
}
.role-pill.leader {
  color: var(--white);
  background: rgba(40,230,111,.18);
  border: 1px solid rgba(40,230,111,.35);
}

.journey-layout {
  display: grid;
  grid-template-columns: 1fr .9fr;
  gap: 22px;
  margin-top: 18px;
}
.journey-form, .reward-settings-form {
  display: grid;
  gap: 14px;
}
.journey-form label,
.reward-settings-form label,
.editor-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}
.journey-form textarea { resize: vertical; }

.journey-preview {
  display: grid;
  gap: 14px;
}
.goal-card {
  min-height: 145px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(40,230,111,.11), rgba(255,255,255,.03)),
    rgba(0,0,0,.18);
}
.goal-card span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 13px;
  color: #001b08;
  background: var(--green);
  font-weight: 900;
}
.goal-card h4, .goal-card p { margin: 0; }
.goal-card p { margin-top: 8px; line-height: 1.55; }

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.upload-box {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 18px;
  border: 1px dashed rgba(40,230,111,.55);
  border-radius: 22px;
  background: rgba(40,230,111,.06);
}
.upload-box label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}
.certificate-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.cert-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.22);
}
.cert-item strong {
  display: block;
  margin-bottom: 4px;
}
.cert-item span {
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.reward-rules-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.reward-rule-item {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.22);
}
.reward-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.reward-rule-meta span {
  display: inline-flex;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.07);
  font-size: 12px;
  font-weight: 800;
}
.reward-rule-meta .active {
  color: #001b08;
  background: var(--green);
}
.rules {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(0,0,0,.25);
}

.insights-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 18px;
}
.insights-grid div {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(0,0,0,.18);
}

.management-card { border-color: rgba(40,230,111,.28); }
.management-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.18);
}
.tab-btn {
  color: var(--muted);
  background: transparent;
}
.tab-btn.active {
  color: #001b08;
  background: var(--green);
}
.management-panel { display: none; }
.management-panel.active { display: block; }
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.performer-editor-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.performer-editor-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: rgba(0,0,0,.18);
}
.performer-editor-card h4 {
  margin: 0 0 14px;
}
.performer-editor-card label {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 700;
}

.toggle-list { display: grid; gap: 12px; }
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.22);
  color: var(--white);
  font-weight: 800;
}
.toggle-row input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}
.is-hidden-by-management { display: none !important; }

body.font-compact { font-size: calc(16px * .94); }
body.font-large { font-size: calc(16px * 1.08); }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  opacity: 0;
  transform: translateY(12px);
  padding: 14px 18px;
  border-radius: 16px;
  color: #001b08;
  background: var(--green);
  font-weight: 900;
  transition: .25s ease;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1280px) {
  .top-performers-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .performer-card { min-height: 330px; }
  .performer-score-ring { width: 136px; height: 136px; outline-width: 10px; }
  .performer-score strong { font-size: 42px; }
}
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    height: auto;
  }
  .nav { grid-template-columns: repeat(7, 1fr); }
  .stats-grid,
  .two-column,
  .journey-layout,
  .insights-grid,
  .performer-editor-grid {
    grid-template-columns: 1fr;
  }
  .top-performers-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .performer-card {
    min-height: 315px;
    padding: 16px;
  }
  .performer-score-ring {
    width: 122px;
    height: 122px;
    outline-width: 8px;
  }
  .performer-score strong {
    font-size: 38px;
  }
}
@media (max-width: 720px) {
  .main, .sidebar { padding: 18px; }
  .topbar, .topbar-actions, .section-header, .filters, .management-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .nav { grid-template-columns: 1fr 1fr; }
  .stats-grid, .editor-grid, .form-grid, .insights-grid { grid-template-columns: 1fr; }
  .hero { padding: 22px; }
  .hero h3 { font-size: 36px; }
  .top-performers-grid { grid-template-columns: 1fr; }
  .performer-card { padding: 20px; min-height: 320px; }
  .performer-score-ring { width: 144px; height: 144px; outline-width: 10px; }
  .performer-score strong { font-size: 46px; }
  .performer-meta { align-items: flex-start; }
  .performer-meta img {
    width: 68px;
    height: 68px;
    border-radius: 18px;
  }
}


/* v7 adaptive browser-width layout + approximately 2pt smaller typography */
html {
  font-size: 13.33px;
}

.app-shell {
  grid-template-columns: clamp(220px, 18vw, 290px) minmax(0, 1fr);
}

.sidebar {
  padding: clamp(18px, 2vw, 28px);
}

.main {
  width: 100%;
  max-width: none;
  padding: clamp(16px, 2vw, 28px);
}

.hero {
  width: 100%;
  padding: clamp(20px, 2.4vw, 32px);
}

.hero h3 {
  max-width: min(880px, 100%);
  font-size: clamp(28px, 3.4vw, 50px);
}

.hero-copy p {
  font-size: 15px;
}

.brand h1 {
  font-size: 18px;
}

.sidebar-card h2 {
  font-size: 34px;
}

.stat-card h3 {
  font-size: 28px;
}

.performer-score strong {
  font-size: 42px;
}

.performer-score span {
  font-size: 12px;
}

.performer-meta strong {
  font-size: 16px;
}

.performer-meta p {
  font-size: 12px;
}

.eyebrow {
  font-size: 10px;
}

th {
  font-size: 11px;
}

.badge {
  font-size: 10px;
}

.role-pill {
  font-size: 10px;
}

.pill {
  font-size: 11px;
}

button,
input,
select,
textarea {
  font-size: 13px;
}

.top-performers-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

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

.insights-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.editor-grid,
.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.performer-editor-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (min-width: 1440px) {
  .top-performers-grid {
    grid-template-columns: repeat(3, minmax(260px, 1fr));
  }

  .performer-card {
    min-height: 330px;
  }
}

@media (max-width: 1180px) {
  .top-performers-grid {
    grid-template-columns: repeat(3, minmax(190px, 1fr));
  }

  .performer-card {
    min-height: 300px;
    padding: 14px;
  }

  .performer-score-ring {
    width: 112px;
    height: 112px;
    outline-width: 8px;
  }

  .performer-score strong {
    font-size: 34px;
  }

  .performer-meta {
    gap: 10px;
  }

  .performer-meta img {
    width: 54px;
    height: 54px;
    border-radius: 15px;
  }
}

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

  .sidebar {
    position: relative;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  }

  .top-performers-grid {
    grid-template-columns: repeat(3, minmax(170px, 1fr));
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .performer-card {
    min-width: 170px;
  }
}

@media (max-width: 720px) {
  html {
    font-size: 13px;
  }

  .top-performers-grid {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }

  .performer-card {
    min-width: 0;
  }

  .hero h3 {
    font-size: 30px;
  }
}

/* v8 section layout refinement */
.journey-layout-v8 {
  grid-template-columns: minmax(280px, .85fr) minmax(360px, 1.15fr);
  align-items: start;
}
.journey-agent-picker {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 14px;
}
.journey-agent-picker select {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}
.journey-layout-v8 .journey-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.journey-input-panel,
.reward-settings-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.16);
}
.certificates-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1.08fr) minmax(320px, .92fr);
  gap: 22px;
  margin-bottom: 22px;
  align-items: start;
}
.verification-box {
  min-height: 350px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(40,230,111,.08), rgba(255,255,255,.025)),
    rgba(0,0,0,.18);
}
.certificates-verification-card .certificate-list {
  margin-top: 18px;
}
.rewards-layout {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(340px, .9fr);
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}
.reward-form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.current-rules-panel .rules {
  margin-top: 0;
  min-height: 100%;
}
.current-rules-panel {
  position: sticky;
  top: 18px;
}
@media (max-width: 1080px) {
  .journey-layout-v8,
  .certificates-layout,
  .rewards-layout {
    grid-template-columns: 1fr;
  }
  .current-rules-panel {
    position: static;
  }
}
@media (max-width: 720px) {
  .reward-form-grid {
    grid-template-columns: 1fr;
  }
  .verification-box {
    min-height: auto;
  }
}


/* v9 alignment refinements */
.journey-layout-v8 {
  align-items: stretch;
}

.journey-left-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
}

.journey-layout-v8 .journey-preview {
  height: 100%;
}

.journey-layout-v8 .goal-card {
  min-height: 0;
}

.journey-input-panel {
  height: 100%;
  display: grid;
  align-content: stretch;
}

.journey-input-panel label {
  min-height: 0;
}

.journey-input-panel textarea {
  min-height: 0;
  height: 100%;
}

.goal-card span {
  width: fit-content;
  min-width: 82px;
  padding: 0 12px;
  white-space: nowrap;
}

.certificates-layout {
  align-items: stretch;
}

.certificates-verification-card,
.certificate-upload-card {
  height: 100%;
}

.certificate-upload-card {
  display: flex;
  flex-direction: column;
}

.certificate-upload-card .upload-box {
  flex: 1;
  align-content: start;
}

.rewards-layout {
  align-items: stretch;
}

.reward-settings-panel,
.current-rules-panel,
.current-rules-panel .rules {
  height: 100%;
}

.current-rules-panel {
  display: flex;
}

.current-rules-panel .rules {
  width: 100%;
}

.reward-rules-list {
  height: calc(100% - 34px);
  align-content: start;
}

@media (max-width: 1080px) {
  .journey-input-panel,
  .certificates-verification-card,
  .certificate-upload-card,
  .reward-settings-panel,
  .current-rules-panel,
  .current-rules-panel .rules {
    height: auto;
  }

  .journey-input-panel textarea {
    height: auto;
  }
}


/* v10 detailed alignment refinements */
.journey-layout-v8 {
  align-items: start;
}

.journey-left-panel {
  grid-template-rows: auto auto;
}

.journey-agent-picker {
  margin-bottom: 14px;
}

.journey-input-panel {
  padding-top: 0;
  display: grid;
  gap: 14px;
  align-content: start;
}

.journey-input-panel label:first-child {
  margin-top: 0;
}

.journey-input-panel textarea {
  height: auto;
}

.goal-card {
  display: grid;
  align-content: start;
  gap: 8px;
}

.goal-card span {
  margin-bottom: 0;
}

.save-goals-btn {
  justify-self: start;
  width: fit-content;
  padding: 9px 13px;
  font-size: 12px;
}

.certificate-upload-card .section-header {
  align-items: flex-start;
}

.rewards-layout {
  align-items: start;
}

.reward-settings-panel,
.current-rules-panel,
.current-rules-panel .rules {
  height: auto;
}

.active-rules-box {
  max-height: 430px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.active-rules-spacer {
  height: 79px;
  flex: 0 0 auto;
}

.active-rules-box h4 {
  margin: 0 0 14px;
}

.reward-rules-list {
  overflow-y: auto;
  padding-right: 6px;
  height: auto;
  max-height: 300px;
  align-content: start;
}

.reward-rules-list::-webkit-scrollbar {
  width: 8px;
}

.reward-rules-list::-webkit-scrollbar-track {
  background: rgba(255,255,255,.06);
  border-radius: 999px;
}

.reward-rules-list::-webkit-scrollbar-thumb {
  background: rgba(40,230,111,.55);
  border-radius: 999px;
}

@media (max-width: 1080px) {
  .active-rules-spacer {
    display: none;
  }

  .active-rules-box {
    max-height: none;
  }

  .reward-rules-list {
    max-height: 320px;
  }
}


/* v11 final alignment and system-calculated dashboard refinements */
.journey-input-panel {
  padding-top: 78px;
}

.save-goals-btn {
  justify-self: end;
}

.active-rules-spacer {
  display: none !important;
}

.active-rules-box {
  max-height: 310px;
  padding-top: 18px;
}

.active-rules-box h4 {
  margin-top: 0;
}

.reward-rules-list {
  max-height: 230px;
  overflow-y: auto;
}

.current-rules-panel {
  align-self: start;
}

.todo-form {
  display: grid;
  grid-template-columns: minmax(180px, .55fr) minmax(260px, 1fr) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.18);
}

.todo-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.todo-form input,
.todo-form textarea {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.todo-form textarea {
  resize: vertical;
}

.todo-grid {
  margin-top: 18px;
}

@media (max-width: 1080px) {
  .journey-input-panel {
    padding-top: 0;
  }

  .todo-form {
    grid-template-columns: 1fr;
  }

  .save-goals-btn {
    justify-self: start;
  }
}


/* v12 journey action plans, icons, and table cleanup */
.topbar-actions .primary-btn {
  display: none;
}

.journey-layout-v12 {
  grid-template-columns: minmax(300px, .95fr) minmax(340px, 1.05fr);
  align-items: start;
}

.priority-action-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.16);
}

.priority-action-panel h3 {
  margin: 4px 0 16px;
}

.action-plan-form {
  display: grid;
  gap: 14px;
}

.action-plan-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.action-plan-form textarea {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
}

.action-plan-form button {
  justify-self: start;
}

.action-plan-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.action-plan-card,
.todo-card {
  position: relative;
  padding: 16px;
  padding-right: 48px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.20);
}

.action-plan-card strong,
.todo-card h4 {
  margin: 0;
}

.action-plan-card p,
.todo-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.icon-btn,
.trash-btn {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  padding: 0;
  font-weight: 900;
}

.editable-goal-card {
  position: relative;
  padding-right: 58px;
}

.edit-goal-btn {
  position: absolute;
  top: 14px;
  right: 14px;
}

.trash-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 11px;
  padding: 0;
}

.trash-btn:hover,
.icon-btn:hover {
  border-color: rgba(40,230,111,.7);
  background: rgba(40,230,111,.12);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(0,0,0,.68);
  z-index: 100;
}

.modal-overlay.show {
  display: grid;
}

.modal-card {
  width: min(620px, 100%);
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.modal-header,
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.modal-header h3 {
  margin: 0;
}

.modal-card textarea {
  width: 100%;
  margin: 18px 0;
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
  resize: vertical;
}

.management-card .editor-grid label:has([data-editor-target="exportButton"]),
.management-card .editor-grid label:has([data-editor-target="uploadButton"]) {
  display: none;
}

@media (max-width: 1080px) {
  .journey-layout-v12 {
    grid-template-columns: 1fr;
  }
}


/* v13 requested refinements */
.sidebar-card {
  display: none !important;
}

.todo-form {
  grid-template-columns: 1fr;
  align-items: start;
}

.todo-form button {
  justify-self: start;
  width: fit-content;
}

.todo-form input,
.todo-form textarea {
  width: 100%;
}

.priority-action-panel .eyebrow {
  display: none;
}

.reward-rule-item {
  position: relative;
  padding-right: 50px;
}

.section-header .role-pill.leader {
  display: none;
}

.management-card label:has(#toggleSidebarCard) {
  display: none !important;
}

.performer-settings-layout {
  display: grid;
  grid-template-columns: minmax(280px, .85fr) minmax(340px, 1.15fr);
  gap: 22px;
  margin-top: 18px;
}

.performer-score-settings,
.tier-settings-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.16);
}

.performer-score-settings h4,
.tier-settings-card h4 {
  margin: 0 0 14px;
}

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

.tier-rule-form {
  display: grid;
  gap: 12px;
}

.tier-rule-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.tier-rule-form input {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.tier-rule-form button {
  justify-self: start;
}

.tier-rules-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.tier-rule-item {
  position: relative;
  padding: 14px 48px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.22);
}

.tier-rule-item p {
  margin: 8px 0 0;
  color: var(--muted);
}

.filters {
  flex-wrap: wrap;
}

@media (max-width: 1080px) {
  .performer-settings-layout {
    grid-template-columns: 1fr;
  }
}


/* v14 bug fix: ensure management tabs remain clickable */
.management-tabs,
.tab-btn {
  position: relative;
  z-index: 5;
}

.tab-btn {
  pointer-events: auto;
}

.top-performers {
  display: block;
}


/* v15 stable bugfix */
.top-performers,
#topPerformersGrid {
  display: block;
}

.top-performers-grid,
#topPerformersGrid {
  display: grid;
}

.management-panel {
  display: none;
}

.management-panel.active {
  display: block;
}

.tab-btn {
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
}


/* v16 settings, certification scores, theme limits, and leader note layout */
.management-actions,
.settings-save-btn {
  margin-top: 14px;
}

.cert-score-builder {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.cert-score-builder h4 {
  margin: 0 0 12px;
}

.cert-score-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px auto;
  gap: 12px;
  align-items: end;
}

.cert-score-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

.cert-score-form input {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.cert-score-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.cert-score-item {
  position: relative;
  padding: 12px 46px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(0,0,0,.20);
}

.cert-score-item p {
  margin: 6px 0 0;
  color: var(--muted);
}

.todo-form {
  margin-top: 18px;
}

.todo-grid {
  margin-top: 18px;
}

.priority-action-panel h3 {
  margin-top: 12pt;
}

body.bright-mode {
  background:
    radial-gradient(circle at top right, rgba(40,230,111,.14), transparent 34rem),
    linear-gradient(135deg, #f7faf8 0%, #eef5f0 52%, #ffffff 100%);
}

body.bright-mode .sidebar,
body.bright-mode .content-card,
body.bright-mode .stat-card,
body.bright-mode .sidebar-card,
body.bright-mode .hero,
body.bright-mode .performer-card,
body.bright-mode .modal-card {
  background-color: rgba(255,255,255,.84);
}

body.bright-mode input,
body.bright-mode select,
body.bright-mode textarea {
  background: rgba(255,255,255,.88);
  color: #071009;
}

@media (max-width: 720px) {
  .cert-score-form {
    grid-template-columns: 1fr;
  }
}


/* v17 automatic button text contrast */
.primary-btn,
button.primary-btn,
.primary-btn.small {
  color: var(--button-text) !important;
}

.primary-btn svg,
.primary-btn * {
  color: var(--button-text) !important;
}


/* v18 professional chromatic bright mode */
body.bright-mode {
  background:
    radial-gradient(circle at top right, var(--chromatic-bg), transparent 34rem),
    linear-gradient(135deg, var(--black) 0%, #ffffff 54%, var(--black) 100%);
}

body.bright-mode .content-card,
body.bright-mode .stat-card,
body.bright-mode .hero,
body.bright-mode .performer-card,
body.bright-mode .sidebar,
body.bright-mode .modal-card,
body.bright-mode .goal-card,
body.bright-mode .priority-action-panel,
body.bright-mode .journey-input-panel,
body.bright-mode .certificates-verification-card,
body.bright-mode .certificate-upload-card,
body.bright-mode .reward-settings-panel,
body.bright-mode .performer-score-settings,
body.bright-mode .tier-settings-card,
body.bright-mode .verification-box,
body.bright-mode .todo-form {
  background:
    linear-gradient(135deg, rgba(255,255,255,.92), var(--chromatic-panel)),
    rgba(255,255,255,.90);
  border-color: var(--chromatic-border);
}

body.bright-mode .action-plan-card,
body.bright-mode .todo-card,
body.bright-mode .cert-item,
body.bright-mode .reward-rule-item,
body.bright-mode .tier-rule-item,
body.bright-mode .cert-score-item {
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), var(--chromatic-panel)),
    rgba(255,255,255,.92);
  border-color: var(--chromatic-border);
}

body.bright-mode .progress,
body.bright-mode .active-rules-box,
body.bright-mode .upload-box,
body.bright-mode .rules {
  background: rgba(255,255,255,.56);
  border-color: var(--chromatic-border);
}

body.bright-mode input,
body.bright-mode select,
body.bright-mode textarea {
  border-color: var(--chromatic-border);
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), var(--chromatic-panel));
}

body.bright-mode .ghost-btn,
body.bright-mode .icon-btn,
body.bright-mode .trash-btn {
  border-color: var(--chromatic-border);
  background: rgba(255,255,255,.72);
}

body.bright-mode table,
body.bright-mode th,
body.bright-mode td {
  border-color: var(--chromatic-border);
}

body.bright-mode .top-performers {
  border-color: var(--chromatic-border);
}


/* v19 brighter chromatic bright mode + top performers follows theme */
body.bright-mode {
  background:
    radial-gradient(circle at top right, var(--chromatic-bg), transparent 36rem),
    linear-gradient(135deg, #fbfdfc 0%, var(--black) 45%, #ffffff 100%);
}

body.bright-mode .top-performers {
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), var(--chromatic-panel)),
    rgba(255,255,255,.94);
  border: 1px solid var(--chromatic-border);
  box-shadow: 0 22px 70px rgba(15, 30, 20, .07);
}

body.bright-mode .top-performers-header {
  border-bottom-color: var(--chromatic-border);
}

body.bright-mode .top-performers-header span,
body.bright-mode .performer-label,
body.bright-mode .performer-meta p,
body.bright-mode .performer-score span {
  color: var(--muted);
}

body.bright-mode .performer-card {
  background:
    linear-gradient(145deg, rgba(255,255,255,.98), var(--chromatic-panel)),
    rgba(255,255,255,.96);
  border-color: var(--chromatic-border);
  box-shadow: 0 16px 42px rgba(15, 30, 20, .06);
}

body.bright-mode .performer-score-ring {
  background:
    radial-gradient(circle, rgba(255,255,255,.98), var(--chromatic-panel));
  outline-color: var(--chromatic-border);
  box-shadow:
    inset 0 0 0 10px rgba(255,255,255,.72),
    0 18px 46px rgba(15, 30, 20, .08);
}

body.bright-mode .rank-badge {
  background: var(--green);
  color: var(--button-text);
  border-color: transparent;
}

body.bright-mode .performer-meta img {
  border-color: var(--chromatic-border);
}

body.bright-mode .content-card,
body.bright-mode .stat-card,
body.bright-mode .hero,
body.bright-mode .sidebar,
body.bright-mode .modal-card,
body.bright-mode .goal-card,
body.bright-mode .priority-action-panel,
body.bright-mode .certificates-verification-card,
body.bright-mode .certificate-upload-card,
body.bright-mode .reward-settings-panel,
body.bright-mode .performer-score-settings,
body.bright-mode .tier-settings-card,
body.bright-mode .verification-box,
body.bright-mode .todo-form {
  background:
    linear-gradient(135deg, rgba(255,255,255,.97), var(--chromatic-panel)),
    rgba(255,255,255,.96);
}


/* v20 branded dark mode based on selected button color */
body.dark-branded-mode {
  background:
    radial-gradient(circle at top right, var(--chromatic-bg), transparent 34rem),
    radial-gradient(circle at bottom left, rgba(255,255,255,.035), transparent 30rem),
    linear-gradient(135deg, var(--black) 0%, #020403 54%, var(--black) 100%);
}

body.dark-branded-mode .content-card,
body.dark-branded-mode .stat-card,
body.dark-branded-mode .hero,
body.dark-branded-mode .performer-card,
body.dark-branded-mode .top-performers,
body.dark-branded-mode .sidebar,
body.dark-branded-mode .modal-card,
body.dark-branded-mode .goal-card,
body.dark-branded-mode .priority-action-panel,
body.dark-branded-mode .certificates-verification-card,
body.dark-branded-mode .certificate-upload-card,
body.dark-branded-mode .reward-settings-panel,
body.dark-branded-mode .performer-score-settings,
body.dark-branded-mode .tier-settings-card,
body.dark-branded-mode .verification-box,
body.dark-branded-mode .todo-form {
  background:
    linear-gradient(135deg, rgba(255,255,255,.045), var(--chromatic-panel)),
    var(--panel);
  border-color: var(--chromatic-border);
}

body.dark-branded-mode .action-plan-card,
body.dark-branded-mode .todo-card,
body.dark-branded-mode .cert-item,
body.dark-branded-mode .reward-rule-item,
body.dark-branded-mode .tier-rule-item,
body.dark-branded-mode .cert-score-item {
  background:
    linear-gradient(135deg, rgba(255,255,255,.04), var(--chromatic-panel)),
    rgba(0,0,0,.20);
  border-color: var(--chromatic-border);
}

body.dark-branded-mode .top-performers-header {
  border-bottom-color: var(--chromatic-border);
}

body.dark-branded-mode .performer-score-ring {
  background:
    radial-gradient(circle, rgba(255,255,255,.08), var(--chromatic-panel));
  outline-color: var(--chromatic-border);
  box-shadow:
    inset 0 0 0 10px rgba(255,255,255,.035),
    0 18px 48px rgba(0,0,0,.28);
}

body.dark-branded-mode input,
body.dark-branded-mode select,
body.dark-branded-mode textarea {
  border-color: var(--chromatic-border);
  background:
    linear-gradient(135deg, rgba(255,255,255,.055), var(--chromatic-panel));
}

body.dark-branded-mode .ghost-btn,
body.dark-branded-mode .icon-btn,
body.dark-branded-mode .trash-btn {
  border-color: var(--chromatic-border);
  background: rgba(255,255,255,.055);
}

body.dark-branded-mode table,
body.dark-branded-mode th,
body.dark-branded-mode td,
body.dark-branded-mode .progress,
body.dark-branded-mode .rules,
body.dark-branded-mode .upload-box {
  border-color: var(--chromatic-border);
}

body.dark-branded-mode .rank-badge {
  background: var(--green);
  color: var(--button-text);
  border-color: transparent;
}


/* v21 agent table, dark dropdown readability, themed highlight, reward height alignment */
.agent small {
  display: none;
}

body.dark-branded-mode select,
body.dark-branded-mode option,
body:not(.bright-mode) select,
body:not(.bright-mode) option {
  background-color: #050806 !important;
  color: #ffffff !important;
}

body.dark-branded-mode input,
body.dark-branded-mode textarea,
body.dark-branded-mode select,
body:not(.bright-mode) input,
body:not(.bright-mode) textarea,
body:not(.bright-mode) select {
  caret-color: var(--green);
  accent-color: var(--green);
}

::selection {
  background: var(--green);
  color: var(--button-text);
}

::-moz-selection {
  background: var(--green);
  color: var(--button-text);
}

.rewards-layout {
  align-items: stretch !important;
}

.reward-settings-panel,
.current-rules-panel,
.current-rules-panel .rules,
.active-rules-box {
  height: 100% !important;
}

.current-rules-panel {
  align-self: stretch !important;
  display: flex;
}

.current-rules-panel .rules {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.active-rules-box {
  max-height: none !important;
}

.reward-rules-list {
  flex: 1;
  max-height: none !important;
  overflow-y: auto;
  min-height: 0;
}

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 16px;
  padding: 18px;
  color: var(--muted);
  background: rgba(255,255,255,.035);
}

@media (max-width: 1080px) {
  .reward-settings-panel,
  .current-rules-panel,
  .current-rules-panel .rules,
  .active-rules-box {
    height: auto !important;
  }

  .reward-rules-list {
    max-height: 320px !important;
  }
}


/* v22 reward box sizing + certification input limits + tier colors */
.rewards-layout {
  align-items: stretch !important;
}

.reward-settings-panel {
  height: auto !important;
  align-self: stretch;
}

.current-rules-panel {
  align-self: stretch !important;
  display: flex;
  min-height: 0;
}

.current-rules-panel .rules,
.active-rules-box {
  height: 100% !important;
  max-height: none !important;
  width: 100%;
  display: flex;
  flex-direction: column;
}

.reward-rules-list {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none !important;
  overflow-y: auto;
  padding-right: 6px;
}

.cert-score-form {
  grid-template-columns: minmax(0, 25ch) minmax(72px, 8ch) auto;
  justify-content: start;
}

.cert-score-form #certTypeLabel {
  max-width: 25ch;
}

.cert-score-form #certTypeScore {
  max-width: 8ch;
}

.cert-score-form button {
  justify-self: end;
  align-self: end;
}

.tier-rule-form select {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.badge.tier-gold,
.badge.Gold {
  background: rgba(255, 198, 41, .16);
  color: #ffd76a;
  border-color: rgba(255, 198, 41, .34);
}

.badge.tier-silver,
.badge.Silver {
  background: rgba(210, 218, 230, .14);
  color: #d7e0ee;
  border-color: rgba(210, 218, 230, .30);
}

.badge.tier-bronze,
.badge.Bronze {
  background: rgba(205, 127, 50, .18);
  color: #e6a96e;
  border-color: rgba(205, 127, 50, .34);
}

.badge.tier-platinum-blue {
  background: rgba(137, 207, 240, .18);
  color: #9bdcff;
  border-color: rgba(137, 207, 240, .36);
}

.badge.tier-copper {
  background: rgba(255, 214, 223, .22);
  color: #ffe2e9;
  border-color: rgba(255, 214, 223, .42);
}

.badge.tier-starter {
  background: rgba(255,255,255,.10);
  color: var(--muted);
  border-color: var(--line);
}

body.bright-mode .badge.tier-gold,
body.bright-mode .badge.Gold {
  background: rgba(255, 198, 41, .22);
  color: #8a5e00;
}

body.bright-mode .badge.tier-silver,
body.bright-mode .badge.Silver {
  background: rgba(210, 218, 230, .30);
  color: #4c5664;
}

body.bright-mode .badge.tier-bronze,
body.bright-mode .badge.Bronze {
  background: rgba(205, 127, 50, .22);
  color: #86501f;
}

body.bright-mode .badge.tier-platinum-blue {
  background: rgba(137, 207, 240, .30);
  color: #1e6384;
}

body.bright-mode .badge.tier-copper {
  background: rgba(255, 214, 223, .42);
  color: #7f5961;
}

@media (max-width: 720px) {
  .cert-score-form {
    grid-template-columns: 1fr;
  }

  .cert-score-form #certTypeLabel,
  .cert-score-form #certTypeScore {
    max-width: 100%;
  }

  .cert-score-form button {
    justify-self: start;
  }
}


/* v23 active reward rules scroll and compact reward settings */
.reward-settings-panel {
  padding: 14px !important;
}

.reward-settings-panel .form-grid,
.reward-form-grid {
  gap: 10px !important;
}

.reward-settings-panel label {
  gap: 6px;
}

.reward-settings-panel input,
.reward-settings-panel select {
  padding: 9px 11px !important;
  min-height: 40px;
}

.reward-settings-panel .primary-btn {
  margin-top: 8px;
  padding: 10px 14px;
}

.active-rules-box {
  max-height: none !important;
}

.reward-rules-list {
  max-height: 318px !important;
  overflow-y: auto !important;
  padding-right: 6px;
}

.reward-rule-item {
  min-height: 92px;
}

.reward-rule-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-right: 34px;
}

.rule-status-select {
  width: 108px;
  min-width: 108px;
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 12px;
  padding: 7px 9px;
  outline: none;
  font-size: 12px;
}

body.dark-branded-mode .rule-status-select,
body:not(.bright-mode) .rule-status-select {
  background-color: #050806 !important;
  color: #ffffff !important;
}

body.bright-mode .rule-status-select {
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), var(--chromatic-panel));
  color: #071009;
}

@media (max-width: 1080px) {
  .reward-rules-list {
    max-height: 318px !important;
  }
}

@media (max-width: 720px) {
  .reward-rule-topline {
    flex-direction: column;
    padding-right: 38px;
  }

  .rule-status-select {
    width: 100%;
  }
}


/* v24 active reward rules readability bugfix */
.reward-rules-list {
  display: grid;
  gap: 12px;
  max-height: 342px !important;
  overflow-y: auto !important;
  padding-right: 8px;
}

.reward-rule-item {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: auto !important;
  padding: 14px !important;
  padding-right: 14px !important;
  overflow: visible;
}

.reward-rule-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.reward-rule-card-header strong {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
  padding-top: 4px;
}

.reward-rule-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.reward-trash-btn {
  position: static !important;
  inset: auto !important;
  flex: 0 0 auto;
}

.rule-status-select {
  width: 104px;
  min-width: 104px;
  height: 32px;
  padding: 5px 8px !important;
  line-height: 1.2;
}

.reward-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding-right: 0 !important;
}

.reward-rule-meta span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 520px) {
  .reward-rule-card-header {
    grid-template-columns: 1fr;
  }

  .reward-rule-actions {
    justify-content: space-between;
  }

  .rule-status-select {
    width: 100%;
    min-width: 0;
  }
}


/* v25 tier color preview circle */
.tier-color-control {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.tier-color-preview {
  width: 16px;
  height: 16px;
  display: inline-block;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,.35);
  box-shadow: 0 0 0 3px rgba(255,255,255,.06);
}

.tier-color-gold {
  background: #ffd76a;
}

.tier-color-silver {
  background: #d7e0ee;
}

.tier-color-bronze {
  background: #e6a96e;
}

.tier-color-platinum-blue {
  background: #89cff0;
}

.tier-color-copper {
  background: #ffd6df;
}

body.bright-mode .tier-color-preview {
  border-color: rgba(7,16,9,.18);
  box-shadow: 0 0 0 3px rgba(7,16,9,.04);
}


/* v29 agent performance tier examples + 6-row scroll */
.table-wrap {
  max-height: 560px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
}

.table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
  margin: 0;
}

.table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--panel);
  backdrop-filter: blur(14px);
}

body.bright-mode .table-wrap thead th {
  background:
    linear-gradient(135deg, rgba(255,255,255,.98), var(--chromatic-panel)),
    rgba(255,255,255,.96);
}

body.dark-branded-mode .table-wrap thead th {
  background:
    linear-gradient(135deg, rgba(255,255,255,.045), var(--chromatic-panel)),
    var(--panel);
}

.table-wrap::-webkit-scrollbar {
  width: 9px;
}

.table-wrap::-webkit-scrollbar-track {
  background: rgba(255,255,255,.05);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: var(--green);
  border-radius: 999px;
}

.badge.tier-platinum-blue {
  background: rgba(137, 207, 240, .18);
  color: #9bdcff;
  border-color: rgba(137, 207, 240, .36);
}

.badge.tier-copper {
  background: rgba(255, 214, 223, .22);
  color: #ffe2e9;
  border-color: rgba(255, 214, 223, .42);
}

body.bright-mode .badge.tier-platinum-blue {
  background: rgba(137, 207, 240, .30);
  color: #1e6384;
}

body.bright-mode .badge.tier-copper {
  background: rgba(255, 214, 223, .42);
  color: #7f5961;
}


/* v30 separate management page */
.nav a.nav-btn {
  text-decoration: none;
  display: block;
}

.management-link {
  border-color: rgba(40,230,111,.28) !important;
}

.management-page-main {
  min-height: 100vh;
}

.management-topbar {
  margin-bottom: 22px;
}

.management-topbar h2 {
  margin: 4px 0 0;
}

.management-home-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#management {
  scroll-margin-top: 24px;
}

body:not(.bright-mode) .management-home-btn {
  color: var(--white);
}


/* v31 move Things to do + regular textbox example text */
label {
  font-weight: 400;
}

label:has(#journeyAgent),
label:has(#certAgent) {
  font-weight: 700;
}

input::placeholder,
textarea::placeholder {
  font-weight: 400;
  opacity: .72;
}

input,
textarea,
select {
  font-weight: 400;
}

.journey-agent-picker {
  font-weight: 700;
}

/* Keep headings/buttons intentional, but form examples regular */
.form-grid label,
.editor-grid label,
.todo-form label,
.action-plan-form label,
.tier-rule-form label,
.cert-score-form label,
.upload-box label,
.reward-settings-panel label {
  font-weight: 400 !important;
}

.journey-agent-picker,
.journey-agent-picker label,
label:has(#journeyAgent),
label:has(#certAgent) {
  font-weight: 700 !important;
}


/* v34 posters section and renamed nav */
.posters-layout {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(360px, 1.1fr);
  gap: 22px;
  align-items: start;
  margin-top: 18px;
}

.poster-upload-box,
.poster-list-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(0,0,0,.16);
}

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

.poster-upload-box label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 400;
}

.poster-upload-box input {
  border: 1px solid var(--line);
  color: var(--white);
  background: rgba(0,0,0,.28);
  border-radius: 14px;
  padding: 12px 14px;
  outline: none;
}

.poster-upload-box button {
  justify-self: start;
}

.poster-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.poster-list-panel h4 {
  margin: 0 0 14px;
}

.poster-list {
  display: grid;
  gap: 12px;
  max-height: 336px;
  overflow-y: auto;
  padding-right: 6px;
}

.poster-item {
  position: relative;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(0,0,0,.20);
}

.poster-thumb {
  width: 74px;
  height: 54px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.poster-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-item strong {
  display: block;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.poster-item p,
.poster-item small {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.35;
}

.poster-trash-btn {
  position: static !important;
  inset: auto !important;
}

body.bright-mode .poster-upload-box,
body.bright-mode .poster-list-panel,
body.bright-mode .poster-item {
  background:
    linear-gradient(135deg, rgba(255,255,255,.97), var(--chromatic-panel)),
    rgba(255,255,255,.96);
  border-color: var(--chromatic-border);
}

body.dark-branded-mode .poster-upload-box,
body.dark-branded-mode .poster-list-panel,
body.dark-branded-mode .poster-item {
  background:
    linear-gradient(135deg, rgba(255,255,255,.045), var(--chromatic-panel)),
    var(--panel);
  border-color: var(--chromatic-border);
}

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

@media (max-width: 560px) {
  .poster-item {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .poster-trash-btn {
    position: absolute !important;
    top: 10px;
    right: 10px;
  }
}


/* v35 posters label refinement */
.poster-upload-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.poster-upload-label small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}


/* v36 posters upload helper text refinement */
.poster-upload-label small {
  margin-top: 1pt;
  display: inline-block;
}


/* v37 posters text fine tuning */
.poster-hint {
  font-size: 11px;
}


/* v39 agent performance progress bar and tier spacing */
.agent-table .progress,
.table-wrap .progress {
  width: 75%;
  min-width: 92px;
  max-width: 132px;
  background: rgba(150, 160, 155, .34) !important;
  border: 1px solid rgba(150, 160, 155, .22);
  overflow: hidden;
}

.agent-table .progress span,
.table-wrap .progress span {
  display: block;
  height: 100%;
  background: var(--green);
  border-radius: inherit;
}

body.bright-mode .agent-table .progress,
body.bright-mode .table-wrap .progress {
  background: rgba(120, 130, 125, .18) !important;
  border-color: rgba(120, 130, 125, .18);
}

body.dark-branded-mode .agent-table .progress,
body.dark-branded-mode .table-wrap .progress,
body:not(.bright-mode) .agent-table .progress,
body:not(.bright-mode) .table-wrap .progress {
  background: rgba(190, 198, 193, .18) !important;
  border-color: rgba(190, 198, 193, .14);
}

/* Make tier badges readable, especially Platinum Blue */
.agent-table td:last-child,
.table-wrap td:last-child {
  min-width: 128px;
  white-space: nowrap;
}

.badge {
  white-space: nowrap;
  max-width: none;
}

@media (max-width: 920px) {
  .agent-table .progress,
  .table-wrap .progress {
    width: 72%;
    min-width: 82px;
  }

  .agent-table td:last-child,
  .table-wrap td:last-child {
    min-width: 120px;
  }
}


/* v44 restore v39 border design while keeping table alignment */
.agent-table th,
.agent-table td,
.table-wrap table th,
.table-wrap table td {
  text-align: center;
  vertical-align: middle;
}

.agent-table th:first-child,
.agent-table td:first-child,
.table-wrap table th:first-child,
.table-wrap table td:first-child {
  text-align: center;
}

.agent-table .agent-cell,
.table-wrap .agent-cell {
  justify-content: center;
  text-align: center;
}

.agent-table .progress,
.table-wrap .progress {
  margin-left: auto;
  margin-right: auto;
}

.agent-table td small,
.table-wrap td small {
  display: block;
  text-align: center;
}

.agent-table td:nth-child(6),
.table-wrap table td:nth-child(6) {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}


/* v47 bright mode border width refinement */
body.bright-mode .content-card,
body.bright-mode .stat-card,
body.bright-mode .top-performer-card,
body.bright-mode .journey-card,
body.bright-mode .goal-card,
body.bright-mode .action-card,
body.bright-mode .note-card,
body.bright-mode .reward-card,
body.bright-mode .poster-upload-box,
body.bright-mode .poster-list-panel,
body.bright-mode .poster-item,
body.bright-mode .upload-box,
body.bright-mode .certificate-card,
body.bright-mode .settings-panel,
body.bright-mode .management-panel,
body.bright-mode .form-panel,
body.bright-mode .table-wrap,
body.bright-mode .reward-settings-panel,
body.bright-mode .active-rules-panel,
body.bright-mode .tier-rule-card,
body.bright-mode .cert-rule-card,
body.bright-mode .rule-card,
body.bright-mode .tab-panel,
body.bright-mode .preview-card,
body.bright-mode .metric-card,
body.bright-mode .cert-card,
body.bright-mode .todo-card,
body.bright-mode .uploaded-card,
body.bright-mode .active-rule-card,
body.bright-mode .text-settings-panel,
body.bright-mode .design-panel,
body.bright-mode .performer-settings-panel,
body.bright-mode .preview-controls-panel,
body.bright-mode .management-card .panel,
body.bright-mode .management-card .settings-box {
  border-width: 0.5pt !important;
  border-style: solid !important;
}


/* v48 management bright mode: remove dark inner boxes around tab settings */
body.bright-mode .management-card .tab-panel,
body.bright-mode .management-card .settings-panel,
body.bright-mode .management-card .management-panel,
body.bright-mode .management-card .form-panel,
body.bright-mode .management-card .text-settings-panel,
body.bright-mode .management-card .design-panel,
body.bright-mode .management-card .performer-settings-panel,
body.bright-mode .management-card .preview-controls-panel,
body.bright-mode .management-card .panel,
body.bright-mode .management-card .settings-box {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}

/* Keep actual input boxes visible and usable */
body.bright-mode .management-card input,
body.bright-mode .management-card textarea,
body.bright-mode .management-card select,
body.bright-mode .management-card .rule-card,
body.bright-mode .management-card .tier-rule-card,
body.bright-mode .management-card .cert-rule-card,
body.bright-mode .management-card .active-rule-card {
  background: rgba(255, 255, 255, .78) !important;
  border-color: var(--chromatic-border) !important;
}


/* v49 profile settings */
.brand-mark {
  overflow: hidden;
}

.brand-mark.has-profile-photo {
  padding: 0;
  background: transparent;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Profile Settings tab */
.profile-settings-grid {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(420px, 1.3fr);
  gap: 22px;
  align-items: start;
}

.profile-photo-panel,
.profile-form-panel {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(0,0,0,.16);
}

.profile-photo-uploader {
  display: grid;
  gap: 12px;
  justify-items: start;
  color: var(--muted);
  cursor: pointer;
}

.profile-photo-uploader input {
  display: none;
}

.profile-photo-preview {
  width: 132px;
  height: 132px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(40,230,111,.28), rgba(0,150,255,.16));
  color: var(--white);
  font-size: 34px;
  font-weight: 800;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-helper {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.profile-form-panel {
  display: grid;
  gap: 16px;
}

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

.unique-code-note {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.045);
}

.unique-code-note strong {
  display: block;
  margin-bottom: 6px;
}

.unique-code-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

body.bright-mode .profile-photo-panel,
body.bright-mode .profile-form-panel,
body.bright-mode .unique-code-note,
body.bright-mode .profile-photo-preview {
  background: rgba(255,255,255,.72);
  border-color: var(--chromatic-border);
}

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

  .form-grid.two-col {
    grid-template-columns: 1fr;
  }
}


/* v50 profile settings vertical field layout */
.profile-settings-grid {
  grid-template-columns: minmax(240px, .72fr) minmax(360px, 1fr);
  align-items: start;
}

.profile-form-panel .form-grid.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 420px;
  justify-items: stretch;
  align-items: start;
}

.profile-form-panel label {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: stretch;
  text-align: left;
}

.profile-form-panel input,
.profile-form-panel select {
  width: 100%;
  height: 46px;
  border-radius: 16px !important;
  box-sizing: border-box;
}

.profile-form-panel .unique-code-note {
  max-width: 420px;
  text-align: left;
}

.profile-form-panel #saveProfileSettings {
  justify-self: start;
}

body.bright-mode .profile-form-panel input,
body.bright-mode .profile-form-panel select {
  border-radius: 16px !important;
}

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

  .profile-form-panel .form-grid.two-col,
  .profile-form-panel .unique-code-note {
    max-width: 100%;
  }
}


/* v51 profile input polish and connection settings */
.profile-photo-uploader {
  gap: 0;
}

.profile-form-panel input,
.profile-form-panel select {
  color: var(--white);
  background: rgba(0,0,0,.28);
  padding-left: 5pt !important;
}

body.bright-mode .profile-form-panel input,
body.bright-mode .profile-form-panel select {
  color: var(--ink);
  background: rgba(255,255,255,.78) !important;
}

.profile-form-panel input::placeholder {
  color: var(--muted);
}

.connection-settings-panel {
  display: grid;
  gap: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: rgba(0,0,0,.16);
}

.connection-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.connection-header h4 {
  margin: 4px 0 0;
}

.connection-description {
  max-width: 820px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

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

.connection-column {
  display: grid;
  gap: 12px;
  align-content: start;
}

.connection-column h5 {
  margin: 0;
}

.connection-list {
  display: grid;
  gap: 10px;
}

.connection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}

.connection-item strong {
  display: block;
  margin-bottom: 4px;
}

.connection-item p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
}

.connection-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 700;
  text-transform: capitalize;
}

.connection-status.connected {
  color: #062d16;
  background: rgba(40,230,111,.84);
}

.connection-status.pending {
  color: #352102;
  background: rgba(255,193,7,.82);
}

.role-access-note {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.045);
}

.role-access-note strong {
  display: block;
  margin-bottom: 6px;
}

.role-access-note p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

body.bright-mode .connection-settings-panel,
body.bright-mode .connection-item,
body.bright-mode .role-access-note {
  background: rgba(255,255,255,.72);
  border-color: var(--chromatic-border);
}

@media (max-width: 900px) {
  .connection-grid {
    grid-template-columns: 1fr;
  }

  .connection-header {
    flex-direction: column;
  }
}


/* v52 profile settings horizontal title-field alignment */
.profile-form-panel .form-grid.two-col {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  max-width: 560px;
  justify-items: stretch;
  align-items: start;
}

.profile-form-panel label {
  width: 100%;
  display: grid;
  grid-template-columns: 140px minmax(280px, 1fr);
  gap: 14px;
  align-items: center;
  justify-items: stretch;
  text-align: left;
}

.profile-form-panel input,
.profile-form-panel select {
  width: 100%;
  min-width: 0;
  height: 46px;
  border-radius: 16px !important;
  box-sizing: border-box;
  padding-left: 5pt !important;
}

.profile-form-panel .unique-code-note {
  max-width: 560px;
}

@media (max-width: 720px) {
  .profile-form-panel label {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .profile-form-panel .form-grid.two-col,
  .profile-form-panel .unique-code-note {
    max-width: 100%;
  }
}


/* v53 connected-agent dashboard data and top performer square photos */
.performer-meta img {
  width: 54px;
  height: 54px;
  border-radius: 14px !important;
  object-fit: cover;
  flex: 0 0 54px;
}

.top-performers-grid .empty-state {
  grid-column: 1 / -1;
}


/* v55 language selector, export behavior, and metric explanation sizing */
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.language-select {
  height: 38px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--white);
  padding: 0 14px;
  outline: none;
}

body.bright-mode .language-select {
  background: rgba(255,255,255,.78);
  color: var(--ink);
  border-color: var(--chromatic-border);
}

.stat-card span {
  font-size: calc(0.86rem - 2pt);
  line-height: 1.35;
}


/* v56 bugfix: language selector visibility and metric helper text */
.topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.language-select {
  height: 38px;
  min-width: 128px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--white);
  padding: 0 14px;
  outline: none;
}

.language-select option {
  color: #111827;
  background: #ffffff;
}

body.bright-mode .language-select {
  background: rgba(255,255,255,.78);
  color: var(--ink);
  border-color: var(--chromatic-border);
}

.stat-card span {
  font-size: calc(0.86rem - 2pt);
  line-height: 1.35;
}


/* v60 Sales & Recruits section */
.sales-recruits-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr)) auto;
  gap: 14px;
  align-items: end;
  margin-top: 18px;
}

.sales-recruits-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 400;
}

.sales-recruits-form input,
.sales-recruits-form select {
  width: 100%;
  height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.28);
  color: var(--white);
  padding: 0 12px;
  outline: none;
  box-sizing: border-box;
}

.sales-recruits-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.sales-recruits-summary > div {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  background: rgba(255,255,255,.045);
}

.sales-recruits-summary p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
}

.sales-recruits-summary strong {
  display: block;
  line-height: 1.4;
}

body.bright-mode .sales-recruits-form input,
body.bright-mode .sales-recruits-form select,
body.bright-mode .sales-recruits-summary > div {
  background: rgba(255,255,255,.78);
  color: var(--ink);
  border-color: var(--chromatic-border);
}

@media (max-width: 1100px) {
  .sales-recruits-form {
    grid-template-columns: 1fr 1fr;
  }

  .sales-recruits-form button {
    justify-self: start;
  }
}

@media (max-width: 720px) {
  .sales-recruits-form,
  .sales-recruits-summary {
    grid-template-columns: 1fr;
  }
}


/* v61 Sales & Recruits selected agent and comma input layout */
.sales-recruits-form {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  align-items: end;
}

.sales-recruits-form .sales-agent-field {
  grid-column: 1 / 2;
}

.sales-recruits-form .sales-submit-btn {
  grid-column: 1 / 2;
  justify-self: start;
  align-self: start;
  margin-top: -4px;
}

#salesAgentName[size] {
  height: auto;
  min-height: 46px;
  max-height: 190px;
  overflow-y: auto;
  padding-top: 8px;
  padding-bottom: 8px;
}

#annualSalesNominal {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .sales-recruits-form {
    grid-template-columns: 1fr 1fr;
  }

  .sales-recruits-form .sales-agent-field,
  .sales-recruits-form .sales-submit-btn {
    grid-column: 1 / 2;
  }
}

@media (max-width: 720px) {
  .sales-recruits-form {
    grid-template-columns: 1fr;
  }

  .sales-recruits-form .sales-agent-field,
  .sales-recruits-form .sales-submit-btn {
    grid-column: 1 / -1;
  }
}


/* v62 remove Sales & Recruits bottom summary boxes */
.sales-recruits-summary {
  display: none !important;
}


/* v63 Sales & Recruits layout alignment */
.sales-recruits-form-v63 {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.sales-recruits-form-v63 .sales-agent-field {
  grid-column: 1 / 2;
  grid-row: 1;
}

.sales-recruits-form-v63 .annual-sales-field {
  grid-column: 1 / 2;
  grid-row: 2;
}

.sales-recruits-form-v63 .number-cases-field {
  grid-column: 2 / 3;
  grid-row: 2;
}

.sales-recruits-form-v63 .this-week-recruits-field {
  grid-column: 3 / 4;
  grid-row: 2;
}

.sales-recruits-form-v63 .sales-submit-btn {
  grid-column: 3 / 4;
  grid-row: 3;
  justify-self: start;
  align-self: start;
  margin-top: 0;
}

@media (max-width: 1100px) {
  .sales-recruits-form-v63 {
    grid-template-columns: 1fr 1fr;
  }

  .sales-recruits-form-v63 .sales-agent-field {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .sales-recruits-form-v63 .annual-sales-field {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .sales-recruits-form-v63 .number-cases-field {
    grid-column: 2 / 3;
    grid-row: 2;
  }

  .sales-recruits-form-v63 .this-week-recruits-field {
    grid-column: 1 / 2;
    grid-row: 3;
  }

  .sales-recruits-form-v63 .sales-submit-btn {
    grid-column: 1 / 2;
    grid-row: 4;
  }
}

@media (max-width: 720px) {
  .sales-recruits-form-v63 {
    grid-template-columns: 1fr;
  }

  .sales-recruits-form-v63 .sales-agent-field,
  .sales-recruits-form-v63 .annual-sales-field,
  .sales-recruits-form-v63 .number-cases-field,
  .sales-recruits-form-v63 .this-week-recruits-field,
  .sales-recruits-form-v63 .sales-submit-btn {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}


/* v64 Sales & Recruits button position + robust agent dropdown */
.sales-recruits-form-v63 .sales-submit-btn {
  grid-column: 1 / 2 !important;
  grid-row: 3 !important;
  justify-self: start;
  align-self: start;
  margin-top: 0;
}

@media (max-width: 1100px) {
  .sales-recruits-form-v63 .sales-submit-btn {
    grid-column: 1 / 2 !important;
    grid-row: 3 !important;
  }

  .sales-recruits-form-v63 .this-week-recruits-field {
    grid-column: 1 / 2;
    grid-row: 4;
  }
}

@media (max-width: 720px) {
  .sales-recruits-form-v63 .sales-submit-btn {
    grid-column: 1 / -1 !important;
    grid-row: auto !important;
  }
}


/* v65 comma-format minimum sales and reusable connected Agent Name fields */
#tierMinSales,
#annualSalesNominal {
  font-variant-numeric: tabular-nums;
}


/* v66 comma formatted settings fields and shared Agent Name dropdown source */
#tierMinSales,
#scoreSalesUnit,
#annualSalesNominal {
  font-variant-numeric: tabular-nums;
}

#salesAgentName {
  height: 46px !important;
  min-height: 46px !important;
  max-height: none !important;
  overflow: visible !important;
}


/* v67 Sales & Recruits 3-field row with Agent Name below Annual Sales */
.sales-recruits-form-v67 {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  align-items: end;
}

.sales-recruits-form-v67 .annual-sales-field {
  grid-column: 1 / 2;
  grid-row: 1;
}

.sales-recruits-form-v67 .number-cases-field {
  grid-column: 2 / 3;
  grid-row: 1;
}

.sales-recruits-form-v67 .this-week-recruits-field {
  grid-column: 3 / 4;
  grid-row: 1;
}

.sales-recruits-form-v67 .sales-agent-field {
  grid-column: 1 / 2;
  grid-row: 2;
}

.sales-recruits-form-v67 .sales-submit-btn {
  grid-column: 1 / 2;
  grid-row: 3;
  justify-self: start;
  align-self: start;
  margin-top: 0;
}

#tierMinSales {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1100px) {
  .sales-recruits-form-v67 {
    grid-template-columns: 1fr 1fr;
  }

  .sales-recruits-form-v67 .annual-sales-field {
    grid-column: 1 / 2;
    grid-row: 1;
  }

  .sales-recruits-form-v67 .number-cases-field {
    grid-column: 2 / 3;
    grid-row: 1;
  }

  .sales-recruits-form-v67 .this-week-recruits-field {
    grid-column: 1 / 2;
    grid-row: 2;
  }

  .sales-recruits-form-v67 .sales-agent-field {
    grid-column: 1 / 2;
    grid-row: 3;
  }

  .sales-recruits-form-v67 .sales-submit-btn {
    grid-column: 1 / 2;
    grid-row: 4;
  }
}

@media (max-width: 720px) {
  .sales-recruits-form-v67 {
    grid-template-columns: 1fr;
  }

  .sales-recruits-form-v67 .annual-sales-field,
  .sales-recruits-form-v67 .number-cases-field,
  .sales-recruits-form-v67 .this-week-recruits-field,
  .sales-recruits-form-v67 .sales-agent-field,
  .sales-recruits-form-v67 .sales-submit-btn {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}


/* v68 Sales & Recruits Agent Name dropdown fix */
#salesAgentName {
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  overflow: visible !important;
  background: rgba(255,255,255,.78);
}

body:not(.bright-mode) #salesAgentName {
  background: rgba(0,0,0,.28);
}

#salesAgentName[size] {
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  overflow: visible !important;
}


/* v69 Leader Reward Settings Minimum Sales as plain comma text box */
#rewardSalesTarget {
  font-variant-numeric: tabular-nums;
  appearance: textfield;
  -moz-appearance: textfield;
}

#rewardSalesTarget::-webkit-outer-spin-button,
#rewardSalesTarget::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


/* v70 language translation stability */
.language-select,
.ghost-btn,
.primary-btn,
.stat-card,
.content-card,
.performer-card,
.nav-btn {
  box-sizing: border-box;
}

.nav-btn,
.primary-btn,
.ghost-btn,
.stat-card p,
.stat-card span,
.section-header h3,
.section-header p {
  overflow-wrap: normal;
}


/* v72 public website + auth */
.public-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--white);
}

.public-nav {
  width: min(1160px, calc(100% - 32px));
  margin: 18px auto 0;
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255,255,255,.05);
  backdrop-filter: blur(20px);
}

.public-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
}

.public-logo span {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--button-color, #28e66f);
  color: var(--button-text, #06130c);
  font-weight: 900;
}

.public-nav nav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.public-nav nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 999px;
}

.public-nav nav a:hover,
.public-login-link {
  color: var(--white) !important;
  background: rgba(255,255,255,.08);
}

.public-main {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0 72px;
}

.public-hero {
  padding: 64px 24px;
  border-radius: 32px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at top left, rgba(40,230,111,.18), transparent 40%), rgba(255,255,255,.05);
  text-align: center;
}

.public-hero.compact { padding: 40px 24px; }

.public-hero h1 {
  max-width: 820px;
  margin: 8px auto 16px;
  font-size: clamp(36px, 6vw, 68px);
  line-height: .95;
}

.public-hero p {
  max-width: 720px;
  margin: 0 auto 24px;
  color: var(--muted);
}

.public-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.public-grid,
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.public-grid article,
.pricing-card,
.contact-card,
.contact-form,
.auth-page-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px;
  background: rgba(255,255,255,.055);
  box-shadow: var(--shadow);
}

.public-grid p,
.pricing-card p,
.contact-card p {
  color: var(--muted);
}

.pricing-card h2 {
  font-size: 34px;
  margin: 8px 0;
}

.pricing-card.featured {
  border-color: rgba(40,230,111,.55);
}

.pricing-card ul {
  color: var(--muted);
  padding-left: 20px;
  min-height: 90px;
}

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr);
  gap: 18px;
  margin-top: 18px;
}

.contact-form,
.auth-form {
  display: grid;
  gap: 14px;
}

.contact-form label,
.auth-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.contact-form input,
.contact-form textarea,
.auth-form input {
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.25);
  color: var(--white);
  padding: 13px 14px;
  outline: none;
}

.auth-page-card {
  max-width: 520px;
  margin: 0 auto;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.prototype-link {
  margin-top: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.auth-modal[hidden] { display: none; }
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,.58);
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-modal-card {
  width: min(520px, 100%);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #111827;
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 14px;
  border: 0;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
}

.account-info {
  display: grid;
  gap: 6px;
  margin: 12px 0 18px;
  color: var(--muted);
}

body.bright-mode.public-page {
  background: var(--bright-bg);
  color: var(--ink);
}

body.bright-mode .public-nav,
body.bright-mode .public-grid article,
body.bright-mode .pricing-card,
body.bright-mode .contact-card,
body.bright-mode .contact-form,
body.bright-mode .auth-page-card {
  background: rgba(255,255,255,.78);
  color: var(--ink);
  border-color: var(--chromatic-border);
}

body.bright-mode .public-logo,
body.bright-mode .public-login-link {
  color: var(--ink) !important;
}

body.bright-mode .contact-form input,
body.bright-mode .contact-form textarea,
body.bright-mode .auth-form input {
  background: rgba(255,255,255,.9);
  color: var(--ink);
}

@media (max-width: 860px) {
  .public-nav { align-items: flex-start; flex-direction: column; }
  .public-grid, .pricing-grid, .contact-layout { grid-template-columns: 1fr; }
}


/* v73 public pages are standalone dark mode */
body.public-page,
body.public-page.bright-mode {
  background:
    radial-gradient(circle at top left, rgba(40,230,111,.12), transparent 34%),
    radial-gradient(circle at top right, rgba(96,165,250,.10), transparent 30%),
    var(--bg) !important;
  color: var(--white) !important;
}

body.public-page .public-nav,
body.public-page.bright-mode .public-nav,
body.public-page .public-grid article,
body.public-page.bright-mode .public-grid article,
body.public-page .pricing-card,
body.public-page.bright-mode .pricing-card,
body.public-page .contact-card,
body.public-page.bright-mode .contact-card,
body.public-page .contact-form,
body.public-page.bright-mode .contact-form,
body.public-page .auth-page-card,
body.public-page.bright-mode .auth-page-card {
  background: rgba(255,255,255,.055) !important;
  color: var(--white) !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow) !important;
}

body.public-page .public-logo,
body.public-page.bright-mode .public-logo,
body.public-page .public-login-link,
body.public-page.bright-mode .public-login-link {
  color: var(--white) !important;
}

body.public-page .public-nav nav a,
body.public-page.bright-mode .public-nav nav a,
body.public-page .public-grid p,
body.public-page.bright-mode .public-grid p,
body.public-page .pricing-card p,
body.public-page.bright-mode .pricing-card p,
body.public-page .pricing-card ul,
body.public-page.bright-mode .pricing-card ul,
body.public-page .contact-card p,
body.public-page.bright-mode .contact-card p,
body.public-page .contact-form label,
body.public-page.bright-mode .contact-form label,
body.public-page .auth-form label,
body.public-page.bright-mode .auth-form label {
  color: var(--muted) !important;
}

body.public-page .contact-form input,
body.public-page.bright-mode .contact-form input,
body.public-page .contact-form textarea,
body.public-page.bright-mode .contact-form textarea,
body.public-page .auth-form input,
body.public-page.bright-mode .auth-form input {
  background: rgba(0,0,0,.25) !important;
  color: var(--white) !important;
  border-color: var(--line) !important;
}

body.public-page .language-select,
body.public-page.bright-mode .language-select {
  background: rgba(255,255,255,.06) !important;
  color: var(--white) !important;
  border-color: var(--line) !important;
}

body.public-page .language-select option,
body.public-page.bright-mode .language-select option {
  color: #111827 !important;
  background: #ffffff !important;
}

body.public-page .primary-btn,
body.public-page.bright-mode .primary-btn {
  background: var(--button-color, #28e66f) !important;
  color: var(--button-text, #06130c) !important;
}

body.public-page .ghost-btn,
body.public-page.bright-mode .ghost-btn {
  background: rgba(255,255,255,.07) !important;
  color: var(--white) !important;
  border-color: var(--line) !important;
}


/* v74 demo login button */
.demo-login-btn {
  justify-self: start;
  margin-top: -4px;
}

.demo-login-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}


/* v75 hard lock public website to standalone dark mode */
html,
body.public-page,
body.public-page.bright-mode,
body.public-page.public-dark-locked {
  background: #050806 !important;
}

body.public-page,
body.public-page.bright-mode,
body.public-page.public-dark-locked {
  background:
    radial-gradient(circle at top left, rgba(40,230,111,.13), transparent 34%),
    radial-gradient(circle at top right, rgba(96,165,250,.10), transparent 32%),
    #050806 !important;
  color: #ffffff !important;
}

body.public-page *,
body.public-page.bright-mode *,
body.public-page.public-dark-locked * {
  --bright-bg: #050806;
}

body.public-page .public-nav,
body.public-page.bright-mode .public-nav,
body.public-page.public-dark-locked .public-nav,
body.public-page .public-grid article,
body.public-page.bright-mode .public-grid article,
body.public-page .pricing-card,
body.public-page.bright-mode .pricing-card,
body.public-page .contact-card,
body.public-page.bright-mode .contact-card,
body.public-page .contact-form,
body.public-page.bright-mode .contact-form,
body.public-page .auth-page-card,
body.public-page.bright-mode .auth-page-card {
  background: rgba(255,255,255,.055) !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,.10) !important;
}

body.public-page .public-logo,
body.public-page.bright-mode .public-logo,
body.public-page .public-logo strong,
body.public-page.bright-mode .public-logo strong,
body.public-page .public-login-link,
body.public-page.bright-mode .public-login-link,
body.public-page h1,
body.public-page h2,
body.public-page h3,
body.public-page strong {
  color: #ffffff !important;
}

body.public-page .public-nav nav a,
body.public-page.bright-mode .public-nav nav a,
body.public-page p,
body.public-page li,
body.public-page label {
  color: #a8b6ac !important;
}

body.public-page input,
body.public-page textarea,
body.public-page select {
  background: rgba(0,0,0,.28) !important;
  color: #ffffff !important;
  border-color: rgba(255,255,255,.10) !important;
}

body.public-page option {
  color: #111827 !important;
  background: #ffffff !important;
}


/* v76 sign out icon */
.signout-icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.07);
  color: var(--white);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
  flex: 0 0 auto;
}

.signout-icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(40,230,111,.45);
  background: rgba(40,230,111,.12);
}

.signout-icon {
  width: 21px;
  height: 21px;
  display: inline-grid;
  place-items: center;
}

.signout-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

body.bright-mode .signout-icon-btn {
  background: rgba(255,255,255,.82);
  color: var(--ink);
  border-color: var(--chromatic-border);
}


/* v77 public home/pricing tuning */
.home-hero h1 {
  max-width: 960px;
  font-size: clamp(32px, 4.9vw, 62px);
  line-height: 1.02;
  text-wrap: balance;
}

.home-hero-copy {
  max-width: 1180px !important;
  white-space: nowrap;
  font-size: clamp(13px, 1.15vw, 17px);
}

.home-feature-grid h3 {
  font-size: calc(1.17em + 2pt);
  line-height: 1.15;
}

.home-feature-grid p {
  line-height: 1.48;
}

.annual-price {
  margin-top: -4px !important;
  margin-bottom: 14px !important;
  font-weight: 800;
  color: var(--green) !important;
}

@media (max-width: 980px) {
  .home-hero h1 {
    max-width: 760px;
    font-size: clamp(30px, 7vw, 52px);
  }

  .home-hero-copy {
    white-space: normal;
    max-width: 720px !important;
  }
}


/* v78 role-specific dashboard updates */
.role-hidden,
[hidden].role-hidden {
  display: none !important;
}

.demo-login-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.sales-correction-field {
  grid-column: 1 / 2;
}

.agent-dashboard .top-performers-grid {
  grid-template-columns: 1fr;
}

.agent-achievement-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: rgba(255,255,255,.055);
}

.agent-achievement-photo {
  width: 110px;
  height: 110px;
  border-radius: 22px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,.14);
}

.agent-achievement-content h3 {
  margin: 2px 0 14px;
  font-size: 24px;
}

.agent-achievement-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agent-achievement-metrics span {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0,0,0,.12);
  display: grid;
  gap: 4px;
}

.agent-achievement-metrics strong {
  font-size: 22px;
}

.agent-achievement-metrics small,
.agent-reward-copy {
  color: var(--muted);
}

.agent-poster-updates {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.compact-header {
  margin-bottom: 12px;
}

.agent-visible-poster .trash-btn {
  display: none;
}

body.bright-mode .agent-achievement-card,
body.bright-mode .agent-achievement-metrics span {
  background: rgba(255,255,255,.78);
  border-color: var(--chromatic-border);
}

@media (max-width: 700px) {
  .agent-achievement-card {
    grid-template-columns: 1fr;
  }

  .agent-achievement-metrics {
    grid-template-columns: 1fr;
  }
}


/* v79 journey targets, agent metric layout, poster modal */
.journey-target-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.journey-target-field input {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.journey-target-save {
  justify-self: start;
}

.agent-dashboard .stats-grid {
  display: grid;
}

.agent-dashboard .stat-card[style*="display: none"] {
  display: none !important;
}

.agent-dashboard .agent-achievement-content h3 {
  margin-top: 0;
}

.agent-poster-updates .poster-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(298px, 298px));
  gap: 18px;
  align-items: start;
}

.agent-poster-thumb-card {
  width: 298px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 12px;
  background: rgba(255,255,255,.055);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 10px;
  transition: transform .2s ease, border-color .2s ease;
}

.agent-poster-thumb-card:hover {
  transform: translateY(-2px);
  border-color: rgba(40,230,111,.45);
}

.agent-poster-frame {
  width: 298px;
  height: 420px;
  max-width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(0,0,0,.22);
  display: grid;
  place-items: center;
}

.agent-poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-image-modal[hidden] {
  display: none;
}

.poster-image-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,.82);
  display: grid;
  place-items: center;
  padding: 40px;
}

.poster-image-modal img {
  max-width: min(100%, 1100px);
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0,0,0,.55);
}

.poster-modal-close {
  position: fixed;
  top: 22px;
  right: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

body.bright-mode .agent-poster-thumb-card {
  background: rgba(255,255,255,.78);
  color: var(--ink);
  border-color: var(--chromatic-border);
}


/* v80 journey target field design + agent menu fix */
.journey-target-field {
  display: grid;
  gap: 8px;
  font-weight: 700 !important;
  color: inherit;
}

.journey-target-field input {
  width: 100%;
  min-height: 46px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.16);
  color: var(--white);
  padding: 12px 14px;
  font: inherit;
  font-variant-numeric: tabular-nums;
  outline: none;
}

body.bright-mode .journey-target-field input {
  background: rgba(255,255,255,.88);
  color: var(--ink);
  border-color: rgba(9, 48, 25, .12);
}

.journey-target-save {
  margin-top: 5pt;
  justify-self: start;
}

.agent-dashboard .sidebar a[href*="#agents"] {
  display: none !important;
}


/* v81 journey target and agent achievement fixes */
.journey-target-save + .journey-preview {
  margin-top: 5pt;
}

.agent-achievement-metrics span:first-child .badge {
  justify-self: start;
}

.agent-dashboard .stat-card:nth-child(4) p {
  font-size: inherit;
}


/* v82 journey target button and sales update fixes */
.journey-target-save + .journey-preview {
  margin-top: 20pt !important;
}

.sales-submit-btn {
  grid-column: 1 / 2;
  justify-self: start;
  margin-top: 5pt;
}

.sales-correction-field + .sales-submit-btn {
  grid-column: 1 / 2;
}

.leader-dashboard .sales-submit-btn {
  grid-column: 1 / 2;
}


/* v83 agent achievement and metric cards */
.agent-dashboard .agent-achievement-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 900px) {
  .agent-dashboard .agent-achievement-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .agent-dashboard .agent-achievement-metrics {
    grid-template-columns: 1fr;
  }
}


/* v85 agent achievement tier fit */
.agent-dashboard .agent-achievement-metrics .badge {
  font-size: calc(1em - 5pt) !important;
  line-height: 1.1;
  padding: 6px 8px;
  white-space: normal;
  word-break: break-word;
  text-align: center;
  max-width: 100%;
  justify-self: start;
}

.agent-dashboard .agent-achievement-metrics span:first-child strong {
  font-size: calc(22px - 5pt) !important;
}


/* v88 rewards earned vertical list */
.agent-reward-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.agent-reward-items {
  display: grid;
  gap: 8px;
}

.agent-reward-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  color: var(--white);
}

.gold-trophy {
  flex: 0 0 auto;
  font-size: 18px;
  line-height: 1.1;
  filter: drop-shadow(0 2px 7px rgba(255, 196, 0, .24));
}

body.bright-mode .agent-reward-item {
  background: rgba(255,255,255,.78);
  color: var(--ink);
  border-color: var(--chromatic-border);
}


/* v89 agent achievement photo top alignment */
.agent-achievement-card {
  align-items: start !important;
}

.agent-achievement-photo {
  align-self: start !important;
  margin-top: 0 !important;
}

.agent-achievement-content {
  align-self: start !important;
}

.agent-achievement-content h3 {
  margin-top: 0 !important;
  padding-top: 0 !important;
}


/* v90 leader metrics, reward winners, correction placement */
.leader-only-card {
  display: block;
}

.reward-winners-list {
  display: grid;
  gap: 10px;
}

.reward-winner-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}

.reward-winner-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.reward-winner-item span {
  font-weight: 800;
  color: var(--green);
  text-align: right;
}

.reward-winners-filters {
  min-width: 220px;
}

.sales-correction-field {
  grid-column: 1 / 2 !important;
}

.sales-submit-btn {
  grid-column: 1 / 2 !important;
  grid-row: auto !important;
  justify-self: start !important;
  margin-top: 5pt !important;
}

body.bright-mode .reward-winner-item {
  background: rgba(255,255,255,.78);
  border-color: var(--chromatic-border);
}


/* v91 leader metric layout and correction formatting */
.leader-dashboard .stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.leader-dashboard .total-team-sales-card {
  grid-column: 1 / 2;
}

.leader-dashboard .leader-only-card {
  display: block;
}

#salesCorrectionNominal {
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.sample-winner {
  border-style: dashed;
}

@media (max-width: 980px) {
  .leader-dashboard .stats-grid {
    grid-template-columns: 1fr;
  }

  .leader-dashboard .total-team-sales-card {
    grid-column: auto;
  }
}


/* v92 leader metric reorder and reward winners table */
.leader-dashboard .stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.leader-dashboard .total-team-sales-card {
  grid-column: auto;
  order: 1;
}

.leader-dashboard .leader-only-card {
  display: block;
}

.leader-dashboard .leader-only-card:nth-of-type(2) {
  order: 2;
}

.leader-dashboard .leader-only-card:nth-of-type(3) {
  order: 3;
}

.reward-winners-table {
  display: grid;
  gap: 8px;
}

.reward-winners-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.05fr) minmax(220px, 1.4fr) minmax(160px, .9fr);
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255,255,255,.045);
}

.reward-winners-head {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: rgba(255,255,255,.025);
}

.winner-chip {
  display: inline-flex;
  align-items: center;
  margin: 3px 6px 3px 0;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(40,230,111,.12);
  border: 1px solid rgba(40,230,111,.22);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.prize-chip {
  display: inline-flex;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 209, 102, .13);
  border: 1px solid rgba(255, 209, 102, .28);
  color: var(--green);
  font-weight: 900;
  font-size: 12px;
}

body.bright-mode .reward-winners-row {
  background: rgba(255,255,255,.78);
  border-color: var(--chromatic-border);
}

body.bright-mode .winner-chip {
  color: var(--ink);
}

@media (max-width: 980px) {
  .leader-dashboard .stats-grid {
    grid-template-columns: 1fr;
  }

  .reward-winners-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reward-winners-head {
    display: none;
  }
}


/* v94 agent performance table cases + no avatar box */
.agent-name-only {
  gap: 0 !important;
}

.agent-name-only .avatar {
  display: none !important;
}

#agentTable .agent-name-only strong {
  display: inline-block;
  padding-left: 0;
}


/* v95 force cases column visibility */
#agentTable td:nth-child(3),
table th:nth-child(3) {
  text-align: center;
  white-space: nowrap;
}

.agent-name-only {
  gap: 0 !important;
}

.agent-name-only .avatar {
  display: none !important;
}


/* v97 management text settings */
.field-helper {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

input[disabled][data-editor-target="brandName"] {
  opacity: .72;
  cursor: not-allowed;
}


/* v98 text settings and sidebar agency brand spacing */
input[disabled][data-editor-target="brandName"] {
  min-height: 46px;
  width: 100%;
  box-sizing: border-box;
  opacity: 1;
  cursor: not-allowed;
}

.sidebar .brand p,
.sidebar .brand small,
.brand .brand-copy p,
.brand .brand-copy small,
.brand-text p,
.brand-text small,
[data-edit-key="brandTagline"] {
  position: relative;
  top: 5pt;
}


/* v99 reward period options */
.reward-period-mode-field,
.reward-created-days-field,
.reward-date-field {
  min-width: 0;
}

.reward-created-days-field {
  display: none;
}

.reward-rule-meta span:nth-child(2) {
  font-weight: 700;
}


/* v100 connection account management */
.create-agent-form {
  margin: 18px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.035);
}

.section-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.section-subheader h5 {
  margin: 2px 0 0;
  font-size: 16px;
}

.connection-create-grid {
  margin-bottom: 14px;
}

.connection-item-v100 {
  align-items: stretch;
  gap: 14px;
}

.connection-main p {
  margin: 4px 0;
}

.connection-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.danger-btn {
  border: 1px solid rgba(255, 86, 86, .42);
  background: rgba(255, 86, 86, .14);
  color: #ffb4b4;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
}

.danger-btn.small {
  padding: 9px 12px;
  font-size: 12px;
}

.danger-btn:hover {
  background: rgba(255, 86, 86, .22);
}

body.bright-mode .create-agent-form {
  background: rgba(255,255,255,.74);
  border-color: var(--chromatic-border);
}

body.bright-mode .danger-btn {
  color: #9f1f1f;
  background: rgba(220, 38, 38, .09);
  border-color: rgba(220, 38, 38, .32);
}


/* v101 reward period layout and create agent field styling */
.reward-form-grid.period-dates-mode {
  align-items: end;
}

.reward-form-grid.period-dates-mode .reward-period-mode-field {
  grid-column: 1 / 2;
  grid-row: 2;
}

.reward-form-grid.period-dates-mode .reward-date-field:nth-of-type(4) {
  grid-column: 1 / 2;
  grid-row: 3;
}

.reward-form-grid.period-dates-mode .reward-date-field:nth-of-type(5) {
  grid-column: 2 / 3;
  grid-row: 3;
}

.reward-form-grid.period-dates-mode #salesTargetLabel {
  grid-column: 1 / 2;
  grid-row: 4;
}

.reward-form-grid.period-dates-mode #rewardValueLabel {
  grid-column: 2 / 3;
  grid-row: 4;
}

.reward-form-grid.period-dates-mode #recruitsTargetLabel,
.reward-form-grid.period-dates-mode #certificateTargetLabel {
  grid-column: 1 / 2;
  grid-row: 4;
}

.reward-form-grid.period-dates-mode #rewardStatusLabel {
  grid-column: 1 / 2;
}

.reward-form-grid.period-created-days-mode {
  align-items: end;
}

.connection-create-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.connection-create-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.connection-create-grid input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.045);
  color: var(--white);
  padding: 12px 13px;
  font: inherit;
  box-sizing: border-box;
}

.connection-create-grid input::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 28%);
}

.connection-create-grid input[readonly] {
  opacity: .86;
}

.create-agent-created-field {
  grid-column: 1 / 2;
}

body.bright-mode .connection-create-grid input {
  background: rgba(255,255,255,.86);
  color: var(--white);
  border-color: var(--line);
}

body.bright-mode .connection-create-grid label {
  color: var(--muted);
}

@media (max-width: 980px) {
  .reward-form-grid.period-dates-mode .reward-period-mode-field,
  .reward-form-grid.period-dates-mode .reward-date-field:nth-of-type(4),
  .reward-form-grid.period-dates-mode .reward-date-field:nth-of-type(5),
  .reward-form-grid.period-dates-mode #salesTargetLabel,
  .reward-form-grid.period-dates-mode #recruitsTargetLabel,
  .reward-form-grid.period-dates-mode #certificateTargetLabel,
  .reward-form-grid.period-dates-mode #rewardValueLabel,
  .reward-form-grid.period-dates-mode #rewardStatusLabel,
  .create-agent-created-field {
    grid-column: auto;
    grid-row: auto;
  }

  .connection-create-grid {
    grid-template-columns: 1fr;
  }
}


/* v102 connection text and per-account notes polish */
#createAgentAccountForm .section-subheader {
  margin-bottom: 14px;
}

#createAgentAccountForm .section-subheader h5 {
  margin: 0;
}

.connectedConnections .connection-actions,
.connection-column .connection-actions {
  justify-content: flex-end;
}
