:root {
  color-scheme: light;
  --bg: #fff8f8;
  --ink: #2d1718;
  --muted: #7f6669;
  --line: #ecd2d5;
  --panel: #ffffff;
  --panel-soft: #fffafa;
  --accent: #c83f4a;
  --accent-strong: #982b34;
  --accent-soft: #fdecef;
  --accent-wash: #fff3f4;
  --warn: #9a4b13;
  --shadow: 0 18px 48px rgba(93, 30, 38, 0.1);
  --shadow-soft: 0 10px 28px rgba(93, 30, 38, 0.07);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% -8%, rgba(200, 63, 74, 0.12), transparent 32%),
    linear-gradient(180deg, #fffafa 0%, var(--bg) 46%, #ffffff 100%);
  color: var(--ink);
}

body.transportClaimsDisabled #transportClaimSection {
  display: none !important;
}

fieldset:has(#customPlan:checked) #openingGrossField,
fieldset:has(#customPlan:checked) #openingTierPreview {
  display: none !important;
}

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

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 30px 0 44px;
}

.topbar,
.metrics,
.workspace,
.panelHeader,
.totalBox,
.claimRow,
.actions,
.roleNav {
  display: flex;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid rgba(236, 210, 213, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.03;
  letter-spacing: 0;
}

h2 {
  font-size: 22px;
}

.identity,
.status,
.roleNav {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 8px;
  padding: 10px 12px;
}

.identityGroup {
  min-width: 180px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
}

.identity {
  box-shadow: inset 4px 0 0 var(--accent);
}

.identity strong {
  display: block;
  margin-top: 2px;
}

.logoutButton {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--accent-wash);
  color: var(--accent-strong);
  font-weight: 800;
  cursor: pointer;
}

.logoutButton:hover {
  background: var(--accent-soft);
}

.roleNav {
  position: sticky;
  top: 10px;
  z-index: 20;
  width: fit-content;
  gap: 4px;
  margin: 0 0 18px;
  padding: 4px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.tabButton {
  min-height: 36px;
  background: transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: 6px;
}

.tabButton:hover,
.tabButton.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(200, 63, 74, 0.2);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#agentView.active {
  display: grid;
  gap: 18px;
}

.identity span,
article span,
.totalBox span,
.claimRow span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

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

#adminView .metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metrics article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.metrics article {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 18px;
  min-height: 148px;
}

.metrics article::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #f0a3aa);
}

.metrics article:hover,
.panel:hover {
  box-shadow: var(--shadow);
}

.metrics strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.15;
}

.metrics em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.metrics article em:last-child:has(.linkButton),
.metricAction {
  margin-top: auto;
  padding-top: 10px;
}

.metrics .linkButton {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  line-height: 1.2;
  white-space: nowrap;
}

#agentMetrics article {
  min-height: 150px;
}

#agentMetrics article em + em,
.metrics article em:has(.linkButton) {
  padding-top: 8px;
}

.stackedMetricLine {
  display: grid;
  gap: 2px;
}

.stackedMetricLine b {
  color: var(--ink);
  font-size: 15px;
}

.workspace {
  align-items: flex-start;
  gap: 18px;
}

#agentView .metrics {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 0;
}

#agentView .workspace {
  display: grid;
  gap: 18px;
}

#agentView .panel {
  padding: 20px;
}

#agentView .gridTwo,
#agentView .gridThree,
#agentView .uploadGrid {
  gap: 14px;
}

#agentView .claimDetailsGrid {
  grid-template-columns: minmax(140px, 0.8fr) minmax(190px, 1fr) minmax(190px, 1fr);
}

#agentView .claimDetailsGrid label {
  min-width: 0;
}

#agentView .tableLike {
  gap: 10px;
}

#agentView .tableRow,
#agentView fieldset {
  padding: 14px;
}

#agentView .statusWorkspace {
  margin-top: 4px;
}

.loginLayout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 16px;
}

.loginPanel {
  min-height: 100%;
}

.workspace.single {
  display: block;
}

#agentManagementView .workspace.single {
  display: grid;
  gap: 18px;
}

.managementBlock {
  scroll-margin-top: 18px;
}

.panel {
  padding: 20px;
}

form.panel {
  flex: 1 1 680px;
}

.claimStack {
  flex: 1 1 680px;
  display: grid;
  gap: 18px;
}

.claimStack form.panel {
  width: 100%;
}

.separateClaimsSection {
  margin-top: 4px;
}

.separateClaimsGrid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.separateClaimDropdown {
  padding: 0;
  overflow: hidden;
}

.separateClaimDropdown summary {
  min-height: 96px;
  margin: 0;
  padding: 20px;
  cursor: pointer;
  list-style: none;
  border-radius: 8px;
}

.separateClaimDropdown summary:focus {
  outline: none;
}

.separateClaimDropdown summary:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(200, 63, 74, 0.45);
}

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

.separateClaimDropdown form {
  margin: 0;
  padding: 0 20px 20px;
}

.dropdownActionButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(200, 63, 74, 0.18);
  white-space: nowrap;
}

.separateClaimDropdown[open] .dropdownActionButton {
  background: var(--accent-soft);
  color: var(--accent-strong);
  box-shadow: none;
}

.separateClaimDropdown[open] .dropdownActionButton span {
  transform: rotate(180deg);
}

aside.panel {
  flex: 0 1 390px;
}

#agentView #leaderDownlinePanel {
  width: 100%;
}

.widePanel {
  width: 100%;
}

.profileInfoPanel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 22px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.profileInfoPanel div {
  min-height: 74px;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.profileInfoPanel label {
  min-height: 74px;
  margin: 0;
  padding: 16px 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.profileInfoPanel div:nth-child(3n) {
  border-right: 0;
}

.profileInfoPanel label:nth-child(3n) {
  border-right: 0;
}

.profileInfoPanel div:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.profileInfoPanel label:nth-last-child(-n + 3) {
  border-bottom: 0;
}

.profileInfoPanel span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.profileInfoPanel strong {
  display: block;
  margin-top: 7px;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.profileInfoPanel label input,
.profileInfoPanel label select {
  width: 100%;
  margin-top: 7px;
}

.adminAgentProfilePanel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 28px;
  margin: 8px 0 20px;
  padding: 16px 20px;
  border-left: 4px solid var(--accent);
  background: #fff;
}

.adminAgentProfilePanel div,
.adminAgentProfilePanel div:nth-child(3n),
.adminAgentProfilePanel div:nth-last-child(-n + 3),
.adminAgentProfilePanel label,
.adminAgentProfilePanel label:nth-child(3n),
.adminAgentProfilePanel label:nth-last-child(-n + 3) {
  min-height: auto;
  display: grid;
  grid-template-columns: minmax(110px, 0.42fr) minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.adminAgentProfilePanel div:nth-last-child(-n + 2),
.adminAgentProfilePanel label:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.adminAgentProfilePanel span {
  font-size: 11px;
  letter-spacing: 0.02em;
}

.adminAgentProfilePanel strong {
  margin-top: 0;
  font-size: 15px;
  font-weight: 850;
}

.adminAgentProfilePanel input,
.adminAgentProfilePanel select {
  min-height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 15px;
  font-weight: 850;
  box-shadow: none;
  opacity: 1;
  -webkit-text-fill-color: var(--ink);
}

.adminAgentProfilePanel.isEditing input,
.adminAgentProfilePanel.isEditing select {
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fffafa;
}

.sectionDividerHeader {
  margin: 2px 0 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sectionDividerHeader h2 {
  font-size: 20px;
}

.panelHeader {
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

label,
fieldset {
  display: block;
  margin: 0 0 14px;
  color: #3a2224;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  border: 1px solid #dec5c8;
  border-radius: 7px;
  padding: 10px 12px;
  background: var(--panel-soft);
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(200, 63, 74, 0.12);
}

textarea {
  min-height: 138px;
  resize: vertical;
}

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

.compactInputGrid {
  margin-top: 8px;
}

.currentMonthGrossField {
  display: block;
  margin-top: 12px;
}

.gridThree {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.8fr;
  gap: 12px;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--accent-wash);
}

legend {
  padding: 0 6px;
}

.check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 9px;
  font-weight: 600;
}

.check input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.totalBox {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.totalBox strong {
  display: block;
  margin-top: 4px;
  font-size: 30px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(180deg, #d64b55, var(--accent));
  color: white;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(200, 63, 74, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover {
  background: var(--accent-strong);
  box-shadow: 0 10px 22px rgba(152, 43, 52, 0.22);
  transform: translateY(-1px);
}

button.ghost {
  background: #fff0f2;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

button:disabled {
  background: #f4ebec;
  color: var(--muted);
  cursor: default;
  box-shadow: none;
  transform: none;
}

.message {
  min-height: 22px;
  margin: 10px 0 0;
  color: var(--warn);
  font-weight: 700;
}

.claimList {
  display: grid;
  gap: 10px;
}

.financeAgentList {
  display: grid;
  gap: 14px;
}

.financeAgentCard {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--panel-soft);
  box-shadow: inset 4px 0 0 rgba(200, 63, 74, 0.32);
}

.financeAgentHeader {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.45fr auto;
  gap: 12px;
  align-items: center;
}

.financeAgentHeader span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.financeAgentHeader strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.claimRow {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--panel-soft);
}

.actions {
  gap: 8px;
}

.rejectActions {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.rejectReasonPanel {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.rejectReasonPanel label {
  margin: 0;
  gap: 6px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.rejectReasonInput {
  width: 100%;
  min-height: 78px;
  resize: vertical;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: -2px 0 16px;
}

.toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.splitToolbar {
  justify-content: space-between;
}

.splitToolbar div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inlineSearch {
  width: min(420px, 100%);
  margin-top: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tierToneRookie {
  background: #fff7df !important;
  border-color: #efc76b !important;
  color: #6f4a05 !important;
}

.tierToneJunior {
  background: #fde8eb !important;
  border-color: #e9a3aa !important;
  color: #982b34 !important;
}

.tierToneSenior {
  background: #eaf7ef !important;
  border-color: #9ed5ad !important;
  color: #1f6f3c !important;
}

.metrics article.tierToneRookie,
.metrics article.tierToneJunior,
.metrics article.tierToneSenior,
.tableRow.tierToneRookie,
.tableRow.tierToneJunior,
.tableRow.tierToneSenior {
  border-width: 1px;
  box-shadow: var(--shadow-soft);
}

.pill.tierToneRookie,
.pill.tierToneJunior,
.pill.tierToneSenior {
  border: 1px solid currentColor;
}

.metrics article.tierToneSenior strong,
.tableRow.tierToneSenior strong {
  color: #1f6f3c;
}

.metrics article.tierToneJunior strong,
.tableRow.tierToneJunior strong {
  color: #982b34;
}

.metrics article.tierToneRookie strong,
.tableRow.tierToneRookie strong {
  color: #6f4a05;
}

.adminGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.spanAll {
  grid-column: 1 / -1;
}

#commissionSettingsView .settingsLeft {
  grid-column: 1;
}

#commissionSettingsView .extraCommissionSettingsPanel {
  margin-top: 0;
}

.accessGrid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(320px, 1fr);
  gap: 16px;
  margin-bottom: 14px;
}

.singleAccessGrid {
  grid-template-columns: minmax(0, 1fr);
  max-width: 980px;
}

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

.shortcutCard {
  min-height: 112px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  padding: 16px;
  text-align: left;
  box-shadow: none;
}

.shortcutCard:hover {
  background: var(--accent-soft);
  color: var(--ink);
}

.shortcutCard strong,
.shortcutCard span {
  display: block;
}

.shortcutCard strong {
  margin-bottom: 8px;
  font-size: 18px;
}

.shortcutCard span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.agentQuickActions {
  margin-top: 8px;
}

.agentActionGrid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  gap: 14px;
}

.actionCard {
  min-height: 136px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  border-top: 0;
  border-left: 4px solid var(--accent);
  box-shadow: 0 8px 22px rgba(93, 30, 38, 0.05);
}

.actionCard h2 {
  font-size: 19px;
  line-height: 1.2;
}

.actionCard span,
.actionCard strong {
  display: block;
}

.actionCard span {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}

.actionCard strong {
  margin-top: 8px;
  font-size: 18px;
}

.actionCard .smallButton {
  align-self: flex-start;
  white-space: nowrap;
  margin-top: 2px;
}

.searchBar {
  max-width: 560px;
}

.paginationBar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.paginationBar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.uploadPanel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.compactHeader {
  margin-bottom: 10px;
}

.subHeader {
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 22px;
}

.sectionDivider {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.detailSetupGrid {
  margin-bottom: 12px;
}

.manualTierFieldset {
  margin: 10px 0 14px;
}

.manualTierGrid {
  grid-template-columns: 0.7fr 0.7fr 1.2fr;
}

#detailDownlineTable {
  margin-top: 18px;
}

.tableLike,
.ruleStack {
  display: grid;
  gap: 9px;
}

.tierPolicyBlock {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fff8f9 100%);
}

.tierPolicyBlock + .tierPolicyBlock {
  margin-top: 18px;
}

.tierPolicyHeader {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.tierPolicyHeader h2,
.tierPolicyHeader h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.tierRuleStack {
  gap: 12px;
}

.tableHead,
.tableRow {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr 0.7fr;
  gap: 10px;
  align-items: center;
}

.tableHead {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0 12px 2px;
}

.headSort {
  min-height: auto;
  width: fit-content;
  background: transparent;
  color: var(--muted);
  padding: 0;
  text-align: left;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.headSort:hover,
.headSort.activeSort {
  background: transparent;
  color: var(--accent-strong);
  text-decoration: underline;
}

.tableRow,
.ruleItem {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fff;
}

.tableRow {
  box-shadow: 0 6px 16px rgba(93, 30, 38, 0.04);
}

.clickableRow {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.linkText {
  color: var(--accent-strong);
  font-weight: 800;
}

.tableRow:hover {
  border-color: rgba(200, 63, 74, 0.48);
  background: #fffafa;
}

.compactTable {
  margin-top: 10px;
}

.extraCommissionList,
.extraSettingsList {
  display: grid;
  gap: 10px;
}

.extraSettingsHead,
.extraSettingRow {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(130px, 0.6fr) minmax(150px, 0.75fr) minmax(110px, auto);
  align-items: center;
  gap: 12px;
}

.extraSettingsHead {
  padding: 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.extraSettingRow {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.extraSettingRow input {
  min-width: 0;
}

.amountInputWrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.amountInputWrap span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.amountInputWrap input {
  border: 0;
  padding-left: 0;
  background: transparent;
}

.compactCheck {
  align-self: center;
  margin-bottom: 0;
}

.outsourceToggle {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.addExtraBox {
  display: grid;
  grid-template-columns: 1fr 1.35fr 0.75fr auto;
  align-items: end;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-wash);
}

.addExtraBox h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.wideActionButton {
  width: 100%;
  margin-top: 12px;
}

.inviteHead,
.inviteRow {
  grid-template-columns: 1fr 1.2fr 0.85fr 0.55fr 0.8fr 0.8fr;
}

.salesHead,
.salesRow {
  grid-template-columns: 0.65fr 1fr 0.75fr 0.95fr 0.85fr 0.85fr 0.9fr 1fr;
}

.salesSummaryCards {
  margin-bottom: 14px;
}

.salesHead.showTwoMonthOnly,
.salesRow.showTwoMonthOnly,
.salesHead.showYtdOnly,
.salesRow.showYtdOnly,
.salesHead.showLifetimeOnly,
.salesRow.showLifetimeOnly {
  grid-template-columns: 0.65fr 1fr 0.75fr 0.95fr 0.9fr 1fr;
}

.showTwoMonthOnly .salesMetricYtd,
.showTwoMonthOnly .salesMetricLifetime,
.showYtdOnly .salesMetricTwoMonth,
.showYtdOnly .salesMetricLifetime,
.showLifetimeOnly .salesMetricTwoMonth,
.showLifetimeOnly .salesMetricYtd {
  display: none;
}

.managementHead,
.managementRow {
  grid-template-columns: 1fr 1fr 0.9fr 0.7fr 0.6fr;
}

.downlineHead,
.downlineRow {
  grid-template-columns: 1.2fr 1.4fr 1fr 1fr;
}

.claimStatusHead,
.claimStatusRow {
  grid-template-columns: 0.9fr 1.1fr 0.8fr 0.9fr 0.75fr 1fr 1fr;
}

.paidClaimHead,
.paidClaimRow {
  grid-template-columns: 0.8fr 0.9fr 1.25fr 0.85fr 0.9fr 0.75fr;
}

.extraBreakdownHead,
.extraBreakdownRow {
  grid-template-columns: 1fr 1.3fr 0.75fr 0.7fr;
}

.salesClaimHead,
.salesClaimRow,
.detailDealHead,
.detailDealRow {
  grid-template-columns: 0.9fr 1.5fr 0.75fr 0.8fr 0.9fr;
}

.monthlyTierHead,
.monthlyTierRow {
  grid-template-columns: 0.8fr 1.35fr 0.9fr 0.95fr 0.45fr;
}

.monthlyTierRow[data-tier-breakdown-month] {
  cursor: pointer;
}

.monthlyTierRow[data-tier-breakdown-month]:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.tierBreakdownPanel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.tierBreakdownHead,
.tierBreakdownRow {
  grid-template-columns: 0.8fr 1.7fr 0.85fr 0.95fr;
}

.tierRuleHead,
.tierRuleRow {
  grid-template-columns: 1fr 1.25fr 0.75fr 1fr;
}

.documentQueueHead,
.documentQueueRow {
  grid-template-columns: 0.9fr 1.1fr 0.7fr 1fr 1.4fr 0.6fr;
}

.adminReviewHead,
.adminReviewRow {
  grid-template-columns: 0.9fr 1.1fr 0.9fr 0.7fr 1.2fr 0.9fr 1.1fr;
}

.weeklyBatchHead,
.weeklyBatchRow {
  grid-template-columns: 1fr 0.75fr 0.75fr 0.75fr 0.85fr 0.9fr 0.8fr;
}

.batchBreakdownPanel {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.batchBreakdownHead,
.batchBreakdownRow {
  grid-template-columns: 1fr 0.7fr 0.8fr 1.7fr;
}

.adminMetricHead,
.adminMetricRow {
  grid-template-columns: 1fr 0.8fr 1fr 0.85fr 1fr;
}

.financeBreakdownHead,
.financeBreakdownRow {
  grid-template-columns: 0.85fr 1fr 1.25fr 0.6fr 0.6fr 0.65fr 0.8fr 0.75fr;
}

.financePayoutLogHead,
.financePayoutLogRow {
  grid-template-columns: 0.8fr 0.85fr 1fr 0.65fr;
}

.financeDashboardHead,
.financeDashboardRow {
  grid-template-columns: 0.85fr 0.8fr 1fr 1.35fr 0.65fr 0.65fr 0.65fr 0.7fr 0.8fr;
}

.financePayoutDateDetailHead,
.financePayoutDateDetailRow {
  grid-template-columns: 0.8fr 1.1fr 0.9fr 1.25fr 0.65fr 0.65fr 0.65fr 0.75fr;
}

.transportClaimDropdown summary {
  cursor: pointer;
  list-style: none;
}

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

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

.detailDownlineHead,
.detailDownlineRow {
  grid-template-columns: 1.1fr 0.8fr 0.8fr 0.9fr 1fr 0.75fr;
}

.detailOverrideHead,
.detailOverrideRow {
  grid-template-columns: 1fr 0.85fr 0.9fr 0.7fr 0.85fr 1.45fr;
}

.overrideDashboardHead,
.overrideDashboardRow {
  grid-template-columns: 1fr 0.8fr 1.35fr 0.8fr 0.9fr 0.85fr;
}

.downlineClaimDetailHead,
.downlineClaimDetailRow {
  grid-template-columns: 0.8fr 1.25fr 0.75fr 0.8fr 0.95fr 0.85fr 0.9fr;
}

.emptyDownlineRow span {
  color: var(--muted);
  grid-column: 1 / -1;
}

.emptyOverrideDashboardRow span {
  color: var(--muted);
  grid-column: 1 / -1;
}

.compactMetrics {
  grid-template-columns: repeat(3, 1fr);
}

.editableRule label {
  margin: 10px 0 0;
}

.smallButton {
  min-height: 32px;
  padding: 6px 11px;
  font-size: 12px;
}

.activeSort {
  background: var(--accent);
  color: #fff;
}

.rankBadge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 900;
}

.linkButton {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 30px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 4px 8px;
  text-align: left;
  font-weight: 900;
  box-shadow: none;
}

.linkButton:hover {
  background: #fff;
  border-color: rgba(200, 63, 74, 0.3);
  color: var(--accent-strong);
  text-decoration: none;
}

.ruleItem strong,
.ruleItem span {
  display: block;
}

.ruleItem span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.mutedRule {
  background: var(--panel-soft);
}

.warningPill {
  background: #fff0dc;
  color: #8a520f;
}

.mutedPill {
  background: #f4ebec;
  color: #746366;
}

.hint {
  margin-top: -6px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 840px) {
  .topbar,
  .workspace,
  .totalBox,
  .claimRow,
  .roleNav {
    flex-direction: column;
    align-items: stretch;
  }

  .metrics,
  .metrics.threeCards,
  .gridTwo,
  .gridThree,
  .profileInfoPanel,
  .loginLayout,
  .accessGrid,
  .shortcutGrid,
  .separateClaimsGrid,
  .extraSettingsHead,
  .extraSettingRow,
  .addExtraBox,
  .uploadGrid,
  .adminGrid,
  .compactMetrics,
  .tableHead,
  .tableRow,
  .salesHead,
  .salesRow,
  .managementHead,
  .managementRow,
  .downlineHead,
  .downlineRow,
  .claimStatusHead,
  .claimStatusRow,
  .paidClaimHead,
  .paidClaimRow,
  .extraBreakdownHead,
  .extraBreakdownRow,
  .salesClaimHead,
  .salesClaimRow,
  .detailDealHead,
  .detailDealRow,
  .monthlyTierHead,
  .monthlyTierRow,
  .tierBreakdownHead,
  .tierBreakdownRow,
  .tierRuleHead,
  .tierRuleRow,
  .documentQueueHead,
  .documentQueueRow,
  .adminReviewHead,
  .adminReviewRow,
  .weeklyBatchHead,
  .weeklyBatchRow,
  .batchBreakdownHead,
  .batchBreakdownRow,
  .adminMetricHead,
  .adminMetricRow,
  .financeAgentHeader,
  .financeBreakdownHead,
  .financeBreakdownRow,
  .financePayoutLogHead,
  .financePayoutLogRow,
  .financePayoutDateDetailHead,
  .financePayoutDateDetailRow,
  .overrideDashboardHead,
  .overrideDashboardRow,
  .downlineClaimDetailHead,
  .downlineClaimDetailRow,
  .detailOverrideHead,
  .detailOverrideRow,
  .detailDownlineHead,
  .detailDownlineRow {
    grid-template-columns: 1fr;
  }

  .profileInfoPanel div,
  .profileInfoPanel div:nth-child(3n),
  .profileInfoPanel div:nth-last-child(-n + 3),
  .profileInfoPanel label,
  .profileInfoPanel label:nth-child(3n),
  .profileInfoPanel label:nth-last-child(-n + 3) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .profileInfoPanel div:last-child,
  .profileInfoPanel label:last-child {
    border-bottom: 0;
  }

  .adminAgentProfilePanel div,
  .adminAgentProfilePanel div:nth-child(3n),
  .adminAgentProfilePanel div:nth-last-child(-n + 3),
  .adminAgentProfilePanel label,
  .adminAgentProfilePanel label:nth-child(3n),
  .adminAgentProfilePanel label:nth-last-child(-n + 3) {
    grid-template-columns: 1fr;
    gap: 4px;
    border-bottom: 1px solid var(--line);
  }

  .adminAgentProfilePanel div:last-child,
  .adminAgentProfilePanel label:last-child {
    border-bottom: 0;
  }

  #commissionSettingsView .settingsLeft {
    grid-column: auto;
    grid-row: auto;
  }
}
