/* REI v3 CRM — Built on the official rei-theme.css foundation + Satoshi font */
:root {
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --pop-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

.rei-theme {
  color-scheme: light;
  --rei-bg: #fbfbfa;
  --rei-surface: #ffffff;
  --rei-sidebar: #f5f5f4;
  --rei-raised: #ffffff;
  --rei-hover: #f0f0ee;
  --rei-selected: #e8e8e5;
  --rei-text: #202020;
  --rei-muted: #666663;
  --rei-faint: #757570;
  --rei-border: #e7e7e4;
  --rei-border-strong: #c8c8c2;
  --rei-primary: #242424;
  --rei-on-primary: #ffffff;
  --rei-focus: #516cbd;
  --rei-success: #21683d;
  --rei-success-bg: #eaf4ed;
  --rei-info: #345d94;
  --rei-info-bg: #edf2fa;
  --rei-warning: #805c1b;
  --rei-warning-bg: #faf1df;
  --rei-danger: #ac3737;
  --rei-danger-bg: #fbeded;
  --rei-violet: #6b528a;
  --rei-violet-bg: #f1edf7;
  --rei-shadow: 0 8px 30px rgb(0 0 0 / 7%);
  --rei-font: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rei-font-num: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --rei-mono: 'Inter', monospace;
  --rei-text-xs: 11px;
  --rei-text-sm: 12px;
  --rei-text-base: 13px;
  --rei-text-lg: 16px;
  --rei-text-title: 22px;
  --rei-space-1: 4px;
  --rei-space-2: 8px;
  --rei-space-3: 12px;
  --rei-space-4: 16px;
  --rei-space-5: 20px;
  --rei-space-6: 24px;
  --rei-radius-sm: 4px;
  --rei-radius-control: 6px;
  --rei-radius-card: 10px;
  --rei-radius-panel: 12px;
  --rei-control-height: 32px;
  --rei-row-height: 52px;
  --rei-sidebar-width: 216px;
  --rei-duration: 140ms;
  color: var(--rei-text);
  background: var(--rei-bg);
  font: 500 var(--rei-text-base)/1.5 var(--rei-font);
  -webkit-font-smoothing: antialiased;
}

/* Tones that replace outlines in dark. In light they give back what each rule used before. */
.rei-theme {
  --rei-divider: var(--rei-border);
  --rei-fill: var(--rei-surface);
  --rei-fill-hover: var(--rei-hover);
  --rei-field: var(--rei-surface);
  --rei-edge-focus: var(--rei-border-strong);
  --rei-scroll: var(--rei-border-strong);
  --rei-placeholder: var(--rei-faint);
  --rei-pop-bg: var(--rei-raised);
  --rei-shadow-pop: 0 18px 44px rgba(0, 0, 0, 0.14), 0 3px 10px rgba(0, 0, 0, 0.06);
  --rei-shadow-modal: 0 24px 60px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.rei-theme[data-rei-theme="dark"] {
  color-scheme: dark;
  --rei-divider: rgba(255, 255, 255, 0.065);
  --rei-fill: rgba(255, 255, 255, 0.07);
  --rei-fill-hover: rgba(255, 255, 255, 0.115);
  --rei-field: rgba(255, 255, 255, 0.06);
  --rei-edge-focus: rgba(255, 255, 255, 0.34);
  --rei-scroll: #3a3a40;
  --rei-placeholder: #7d7d87;
  --rei-pop-bg: rgba(32, 32, 36, 0.96);
  --rei-shadow-pop: 0 20px 50px rgba(0, 0, 0, 0.62), 0 4px 14px rgba(0, 0, 0, 0.35);
  --rei-shadow-modal: 0 28px 70px rgba(0, 0, 0, 0.72);
  --rei-bg: #0f0f11;
  --rei-sidebar: #141416;
  --rei-surface: #18181b;
  --rei-raised: #202024;
  --rei-hover: rgba(255, 255, 255, 0.055);
  --rei-selected: rgba(255, 255, 255, 0.095);
  --rei-text: #f4f4f5;
  --rei-muted: #a1a1aa;
  --rei-faint: #90909a;
  --rei-border: transparent;
  --rei-border-strong: transparent;
  --rei-primary: #f4f4f5;
  --rei-on-primary: #0f0f11;
  --rei-focus: #38bdf8;
  --rei-success: #10b981;
  --rei-success-bg: rgba(16, 185, 129, 0.14);
  --rei-info: #38bdf8;
  --rei-info-bg: rgba(56, 189, 248, 0.14);
  --rei-warning: #f59e0b;
  --rei-warning-bg: rgba(245, 158, 11, 0.14);
  --rei-danger: #f43f5e;
  --rei-danger-bg: rgba(244, 63, 94, 0.14);
  --rei-violet: #a78bfa;
  --rei-violet-bg: rgba(167, 139, 250, 0.14);
  --rei-shadow: 0 8px 30px rgb(0 0 0 / 28%);
}

*, *::before, *::after {
  box-sizing: border-box;
  font-family: var(--rei-font);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--rei-bg);
  color: var(--rei-text);
}

/* Fix dark-mode native dropdown options so they are never white-on-white */
select, option, optgroup {
  background-color: var(--rei-surface);
  color: var(--rei-text);
  font-family: var(--rei-font);
}

.tabular,
.rei-kpi-value,
.rei-count,
.rei-nav-count,
.heatmap-cell,
.heatmap-hour,
.rei-pop-item-right,
input[type="number"],
input[type="date"] {
  font-family: var(--rei-font-num) !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--rei-scroll);
  border-radius: 99px;
}

.rei-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rei-muted { color: var(--rei-muted); }
.rei-faint { color: var(--rei-faint); }
.rei-small { font-size: var(--rei-text-sm); }
.rei-eyebrow {
  font-size: 11px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rei-faint);
  margin: 0;
}

.rei-row { display: flex; align-items: center; gap: 8px; }
.rei-spacer { flex: 1; }

/* Controls */
.rei-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: var(--rei-control-height);
  padding: 5px 11px;
  border: 1px solid var(--rei-border);
  border-radius: var(--rei-radius-control);
  background: var(--rei-fill);
  color: var(--rei-text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 95ms var(--pop-spring), background 130ms ease, color 130ms ease, border-color 130ms ease, box-shadow 140ms ease;
}
.rei-button:active:not(:disabled) {
  transform: scale(0.972);
}
/* Buttons inside table rows keep today's plain behaviour: nothing extra runs in a long list. */
.rei-table .rei-button {
  transition: background 130ms ease, border-color 130ms ease;
}
.rei-table .rei-button:active:not(:disabled) {
  transform: none;
}
.rei-button:hover:not(:disabled) {
  background: var(--rei-fill-hover);
  border-color: var(--rei-border-strong);
}
.rei-button--primary {
  color: var(--rei-on-primary);
  background: var(--rei-primary);
  border-color: var(--rei-primary);
}
.rei-button--primary:hover:not(:disabled) {
  background: var(--rei-primary);
  border-color: var(--rei-primary);
  filter: brightness(0.92);
}
.rei-button--success {
  color: #ffffff;
  background: #1c7c48;
  border-color: #1c7c48;
  font-weight: 600;
}
.rei-button--success:hover:not(:disabled) {
  color: #ffffff;
  background: #16653b;
  border-color: #16653b;
}
.rei-theme[data-rei-theme="dark"] .rei-button--success {
  color: #0b1c12;
  background: #34d399;
  border-color: #34d399;
}
.rei-theme[data-rei-theme="dark"] .rei-button--success:hover:not(:disabled) {
  color: #0b1c12;
  background: #2bc48a;
  border-color: #2bc48a;
}
.rei-button--danger {
  color: #ffffff;
  background: #c53b3b;
  border-color: #c53b3b;
  font-weight: 600;
}
.rei-button--danger:hover:not(:disabled) {
  color: #ffffff;
  background: #a83030;
  border-color: #a83030;
}
.rei-theme[data-rei-theme="dark"] .rei-button--danger {
  color: #1f0a0a;
  background: #f87171;
  border-color: #f87171;
}
.rei-theme[data-rei-theme="dark"] .rei-button--danger:hover:not(:disabled) {
  color: #1f0a0a;
  background: #ef5a5a;
  border-color: #ef5a5a;
}
.rei-copy-btn--accent {
  background: var(--rei-info-bg);
  border-color: transparent;
  color: var(--rei-info);
}
.rei-copy-btn--accent:hover {
  border-color: var(--rei-info);
}
.rei-button--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--rei-muted);
}
.rei-button--ghost:hover:not(:disabled) {
  background: var(--rei-hover);
  color: var(--rei-text);
}
.rei-button--sm {
  min-height: 26px;
  padding: 3px 8px;
  font-size: 11px;
}

.rei-input, .rei-select, .rei-textarea {
  min-height: var(--rei-control-height);
  width: 100%;
  color: var(--rei-text);
  background: var(--rei-field);
  border: 1px solid var(--rei-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}
select.rei-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.rei-input:focus, .rei-select:focus, .rei-textarea:focus, .rei-select.popover-open {
  border-color: var(--rei-edge-focus);
}
.rei-input::placeholder { color: var(--rei-placeholder); }

/* Label with inline Copy / Action buttons */
.rei-label {
  display: grid;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--rei-muted);
}
/* The rate boxes of one rebate mode, sitting in the form's own grid */
.rei-rate-set {
  display: contents;
}
.rei-rate-set[hidden] {
  display: none;
}
.rei-rate-set--tiers:not([hidden]) {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.rei-label-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.rei-copy-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rei-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid var(--rei-border);
  background: var(--rei-hover);
  color: var(--rei-text);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
}
.rei-copy-btn:hover {
  border-color: var(--rei-border-strong);
  background: var(--rei-selected);
}

/* Custom Brand Switcher Pill Trigger & Uniform Floating Popover Dropdown */
.brand-toggle-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 9px;
  border: 1px solid var(--rei-border);
  background: var(--rei-fill);
  color: var(--rei-text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 130ms ease, background 130ms ease;
}
.brand-toggle-btn:hover, .brand-toggle-btn.popover-open {
  border-color: var(--rei-border-strong);
  background: var(--rei-fill-hover);
}
.brand-toggle-btn.is-locked {
  cursor: default;
  opacity: 0.95;
}
.brand-toggle-btn.is-locked:hover {
  background: var(--rei-fill);
  border-color: var(--rei-border);
}
.rei-sidebar .brand-toggle-btn {
  flex-shrink: 0;
  height: 33px;
  /* The dot sits on the same line as the icons below it, open or closed. */
  padding: 7px 11px 7px 13px;
  overflow: hidden;
  transition: border-color 130ms ease, background 130ms ease;
}
.brand-toggle-left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.rei-sidebar #brandTriggerLabel {
  white-space: nowrap;
}
.brand-toggle-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.pop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}
.pop-dot--all, .pop-dot--green { background: #10b981; }
.pop-dot--rei, .pop-dot--teal { background: #2dd4bf; }
.pop-dot--beton, .pop-dot--purple { background: #c084fc; }
.pop-dot--amber { background: #fbbf24; }
.pop-dot--ram, .pop-dot--blue { background: #38bdf8; }
.pop-dot--ygbet, .pop-dot--pink { background: #f472b6; }
.pop-dot--danger { background: #f87171; }
.pop-dot--muted { background: #71717a; }

.rei-dropdown-popover {
  position: fixed;
  min-width: 224px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--rei-raised);
  border: 1px solid var(--rei-border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--rei-shadow);
  color: var(--rei-text);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rei-theme[data-rei-theme="dark"] .rei-dropdown-popover {
  background: var(--rei-pop-bg);
  border-color: transparent;
  box-shadow: var(--rei-shadow-pop);
}
.rei-dropdown-popover {
  display: flex !important;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  transform-origin: top left;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  will-change: transform, opacity;
  transition: opacity 150ms var(--pop-spring), transform 180ms var(--pop-spring), visibility 0ms linear 0ms;
}
.rei-dropdown-popover[hidden] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(var(--pop-y, -7px)) scale(0.96);
  pointer-events: none;
  interactivity: inert;
  transition: opacity 135ms ease, transform 165ms var(--pop-spring), visibility 0ms linear 165ms;
}
.rei-pop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 10px 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rei-faint);
}
.rei-pop-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--rei-text);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 110ms ease, color 110ms ease, border-color 110ms ease;
}
.rei-pop-item:hover:not(.selected) {
  background: var(--rei-hover);
  color: var(--rei-text);
}
.rei-pop-item.selected {
  background: var(--rei-selected);
  border-color: var(--rei-border-strong);
  color: var(--rei-text);
  font-weight: 600;
}
.rei-pop-item-left {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rei-pop-item-right {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.rei-pop-count {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--rei-muted);
  background: var(--rei-bg);
  border: 1px solid var(--rei-border);
  padding: 1px 6px;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}
.rei-pop-item.selected .rei-pop-count {
  background: var(--rei-surface);
  border-color: var(--rei-border-strong);
  color: var(--rei-text);
}
.rei-pop-shortcut {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--rei-faint);
  font-variant-numeric: tabular-nums;
}
.rei-pop-check {
  width: 14px;
  height: 14px;
  stroke: var(--rei-text);
  stroke-width: 2.4;
  fill: none;
}

.rei-drp-Suggestions {
  background: var(--rei-pop-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--rei-border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--rei-shadow-pop);
  transform-origin: top left;
  transition: opacity 145ms var(--pop-spring), transform 165ms var(--pop-spring), display 165ms allow-discrete;
}
/* The script closes these lists with an inline display: none. These match that, and the transition above holds the list on screen while it fades. */
.rei-drp-Suggestions[style*="display:none"],
.rei-drp-Suggestions[style*="display: none"] {
  opacity: 0;
  transform: translateY(var(--pop-y, -6px)) scale(0.965);
  pointer-events: none;
  interactivity: inert;
}
@starting-style {
  .rei-drp-Suggestions {
    opacity: 0;
    transform: translateY(var(--pop-y, -6px)) scale(0.965);
  }
}

.rei-search { position: relative; }
.rei-search > .rei-icon {
  position: absolute;
  left: 10px;
  top: 8px;
  color: var(--rei-faint);
  pointer-events: none;
}
.rei-search > .rei-input { padding-left: 32px; }

.rei-kbd {
  font: 10px var(--rei-font);
  color: var(--rei-faint);
  border: 1px solid var(--rei-border);
  border-radius: 4px;
  padding: 1px 5px;
}

/* Badges with 5px dot */
.rei-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  color: var(--rei-muted);
  background: var(--rei-hover);
  white-space: nowrap;
}
.rei-badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
/* Brand tags: the dot takes the brand's sidebar colour, the words stay calm. */
.rei-badge--brand-ram::before { background: #38bdf8; }
.rei-badge--brand-ygbet::before { background: #f472b6; }
.rei-badge--brand-ace::before { background: #fbbf24; }
.rei-badge--brand-beton::before { background: #c084fc; }
.rei-badge--brand-rei::before { background: #2dd4bf; }
.rei-badge--success { background: var(--rei-success-bg); color: var(--rei-success); }
.rei-badge--info { background: var(--rei-info-bg); color: var(--rei-info); }
.rei-badge--warning { background: var(--rei-warning-bg); color: var(--rei-warning); }
.rei-badge--danger { background: var(--rei-danger-bg); color: var(--rei-danger); }
.rei-badge--violet { background: var(--rei-violet-bg); color: var(--rei-violet); }

.rei-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--rei-hover);
  color: var(--rei-muted);
  font-size: 11px;
  font-weight: 600;
}
.rei-avatar--violet { background: var(--rei-violet-bg); color: var(--rei-violet); }
.rei-avatar--blue { background: var(--rei-info-bg); color: var(--rei-info); }
.rei-avatar--green { background: var(--rei-success-bg); color: var(--rei-success); }
.rei-avatar--amber { background: var(--rei-warning-bg); color: var(--rei-warning); }

.rei-card {
  border: 1px solid var(--rei-border);
  border-radius: var(--rei-radius-card);
  background: var(--rei-surface);
  padding: 16px;
}

/* App Frame */
.rei-app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.rei-sidebar {
  flex: 0 0 auto;
  width: var(--rei-sidebar-width);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 12px 10px 14px;
  border-right: 1px solid var(--rei-border);
  background: var(--rei-sidebar);
  overflow: hidden;
  user-select: none;
  will-change: width;
  transition: width 220ms var(--spring);
}

.rei-sidebar.is-collapsed {
  width: 56px;
}

/* Only the list scrolls, so the logo row and the button above it stay put. */
.rei-sidebar > .rei-spacer {
  display: none;
}
.rei-sidebar #sidebarNav {
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
}

.rei-brand {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  height: 30px;
  /* Puts the mark on the same line as the icons below it. */
  padding: 0 0 0 6.5px;
  gap: 8px;
  overflow: hidden;
}

.rei-brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.rei-sidebar-collapse-btn {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--rei-muted);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  border-radius: 7px;
  /* One button, on one row. It rides on the sidebar's edge: inside it when open, just past it in the top bar when closed. */
  position: fixed;
  top: 15px;
  left: 178px;
  z-index: 40;
  transition: color 130ms ease, background 130ms ease, left 220ms var(--spring);
}

.rei-sidebar-collapse-btn:hover {
  background: var(--rei-hover);
  color: var(--rei-text);
}

/* Collapsed Sidebar Mode */
.rei-sidebar.is-collapsed .rei-sidebar-collapse-btn {
  left: 76px;
}
.rei-topbar {
  transition: padding-left 180ms var(--spring);
}
.rei-app.is-sidebar-collapsed .rei-topbar {
  padding-left: 62px;
}

/* Words leave by fading. Once faded they cannot be clicked, reached by keyboard or read out. */
.rei-sidebar .rei-kbd,
.rei-sidebar #brandTriggerLabel,
.rei-sidebar .brand-toggle-right,
.rei-sidebar .rei-nav-item > span:not(.rei-nav-count),
.rei-sidebar .rei-profile > div {
  transition: opacity 135ms ease, transform 170ms var(--spring), visibility 0s linear 0s;
}

.rei-sidebar.is-collapsed .rei-kbd,
.rei-sidebar.is-collapsed #brandTriggerLabel,
.rei-sidebar.is-collapsed .brand-toggle-right,
.rei-sidebar.is-collapsed .rei-nav-item > span:not(.rei-nav-count),
.rei-sidebar.is-collapsed .rei-profile > div {
  opacity: 0;
  transform: translateX(-6px);
  visibility: hidden;
  transition-delay: 0s, 0s, 170ms;
}

.rei-sidebar .rei-kbd {
  flex-shrink: 0;
}

/* The letters leave and the mark stays the same size in the same place. (Inside the logo's own drawing 18 units is about 6px on screen.) */
.rei-sidebar .rei-lettering {
  transition: opacity 130ms ease, transform 160ms var(--spring);
}

.rei-sidebar.is-collapsed .rei-lettering {
  opacity: 0;
  transform: translateX(-18px);
}

.rei-sidebar .rei-nav-title {
  height: 22px;
  overflow: hidden;
  white-space: nowrap;
  transition: opacity 120ms ease, height 180ms var(--spring), padding 180ms var(--spring), visibility 0s linear 0s;
}

.rei-sidebar.is-collapsed .rei-nav-title {
  opacity: 0;
  height: 4px;
  padding-top: 0;
  padding-bottom: 0;
  visibility: hidden;
  transition-delay: 0s, 0s, 0s, 120ms;
}

.rei-sidebar .rei-nav-item {
  position: relative;
  overflow: hidden;
  transition: background 120ms ease, color 120ms ease;
}

.rei-sidebar .rei-nav-item > span:not(.rei-nav-count) {
  white-space: nowrap;
}

/* The count rides on the row's right edge, and lands on the icon's corner as a small badge. It never jumps. */
.rei-sidebar .rei-nav-count {
  position: absolute;
  top: 8px;
  right: 10px;
  min-width: 13px;
  padding: 0;
  border-radius: 999px;
  line-height: 16px;
  text-align: center;
  transition: top 220ms var(--spring), right 220ms var(--spring), background 120ms ease, color 120ms ease, padding 120ms ease;
}
.rei-sidebar.is-collapsed .rei-nav-count {
  top: 2px;
  right: 1px;
  font-size: 11px;
  font-weight: 700;
  background: #e11d48;
  color: #ffffff;
  padding: 0 4px;
  line-height: 13px;
}

/* The name stays as wide as it is when open, so it does not re-wrap during the slide. */
.rei-sidebar .rei-profile > div {
  min-width: 140px !important;
  overflow: hidden;
}

.rei-wordmark {
  width: 68px;
  height: 30px;
  fill: currentColor;
  display: block;
  flex-shrink: 0;
}

.rei-workspace-box {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 2px;
  padding: 6px 8px;
  border: 1px solid var(--rei-border);
  border-radius: 7px;
  background: var(--rei-surface);
}

.rei-workspace-icon {
  width: 22px;
  height: 22px;
  border: 1px solid var(--rei-border);
  border-radius: 5px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.rei-nav {
  display: grid;
  gap: 2px;
}

.rei-nav-title {
  padding: 4px 10px 4px;
}

.rei-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 33px;
  width: 100%;
  padding: 6px 10px;
  color: var(--rei-muted);
  background: none;
  border: 0;
  border-radius: 6px;
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.rei-nav-item:hover {
  background: var(--rei-hover);
  color: var(--rei-text);
}
.rei-nav-item[aria-current="page"] {
  color: var(--rei-text);
  background: var(--rei-selected);
  font-weight: 600;
}
.rei-nav-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--rei-muted);
}

.rei-profile {
  display: flex;
  align-items: center;
  gap: 8px;
  /* The avatar sits on the same line as the icons above it. */
  padding: 10px 0 0 4px;
  border-top: 1px solid var(--rei-border);
  overflow: hidden;
  flex-shrink: 0;
}

/* Main Content */
.rei-main {
  flex: 1;
  min-width: 0;
  contain: layout paint;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.rei-topbar {
  height: 54px;
  padding: 0 28px;
  border-bottom: 1px solid var(--rei-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--rei-surface);
  flex-shrink: 0;
}

.rei-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.rei-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px 40px;
}

.rei-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.rei-page-title {
  font-size: var(--rei-text-title);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin: 0;
}

/* The one line under a page, pop-up or card title. */
.rei-page-subtitle {
  color: var(--rei-muted);
  font-size: var(--rei-text-sm);
  margin: 2px 0 0;
}

/* The title row of a card or table. */
.rei-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.rei-table-shell > .rei-card-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rei-divider);
  margin-bottom: 0;
}
.rei-card-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

/* Underline Tabs (with real GPU-composited sliding active indicator) */
.rei-tabs {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  border-bottom: 1px solid var(--rei-border);
  margin-bottom: 16px;
}
.rei-tab-glide-indicator {
  position: absolute;
  height: 2px;
  bottom: -1px;
  left: 0;
  width: 0;
  transform: translateX(0);
  background: var(--rei-text);
  border-radius: 2px;
  pointer-events: none;
  will-change: transform, width;
  transition: transform 220ms var(--spring), width 220ms var(--spring);
}
.rei-tab-glide-indicator.no-anim {
  transition: none !important;
}
.rei-tab {
  position: relative;
  padding: 0 0 10px;
  border: 0;
  background: none;
  color: var(--rei-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color var(--rei-duration) ease;
}
.rei-tab:hover { color: var(--rei-text); }
.rei-tab[aria-pressed="true"] {
  color: var(--rei-text);
  font-weight: 600;
}
.rei-tabs:not(.has-glide-bar) .rei-tab[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  height: 2px;
  bottom: -1px;
  left: 0;
  right: 0;
  background: var(--rei-text);
  border-radius: 2px;
}

/* Smooth Inner Menu (Route) & Inner Tab Content Transitions */
@keyframes reiRouteEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes reiTabBodyEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
#mainViewport.is-route-swap {
  animation: reiRouteEnter 210ms var(--spring) both;
}
/* Only what sits below the tabs moves. The title and number cards above them stay still,
   and a page with no tabs, like Transactions when its brand changes, changes at once. */
#mainViewport.is-tab-swap > .rei-tabs ~ :not(.rei-txn-brand-bar),
.rei-modal-tab-body.is-tab-swap {
  animation: reiTabBodyEnter 195ms var(--spring) both;
}
.rei-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  background: var(--rei-hover);
  border-radius: 4px;
  color: var(--rei-muted);
  font-size: 11px;
}

.rei-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

/* KPI Strip */
.rei-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.rei-kpi-value {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-top: 6px;
}

/* Data Layout with Side Overview Panel */
.rei-data-layout {
  display: flex;
  align-items: flex-start;
  width: 100%;
}
.rei-data-layout > #mainViewport {
  flex: 1 1 auto;
  min-width: 0;
}

.rei-table-shell {
  overflow-x: auto;
  border: 1px solid var(--rei-border);
  border-radius: var(--rei-radius-card);
  background: var(--rei-surface);
}

.rei-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}
.rei-table th {
  color: var(--rei-muted);
  font-size: 11px;
  font-weight: 500;
  height: 36px;
  background: var(--rei-bg);
  position: relative;
  user-select: none;
  white-space: nowrap;
}

/* Sortable Table Column Headers (Matching Stella & Ant Design 1:1) */
.rei-table th:not(.no-sort):not([data-no-sort]):not(:has(input[type="checkbox"])) {
  cursor: pointer;
  padding-right: 24px;
  transition: color 0.15s ease;
}

.rei-table th:not(.no-sort):not([data-no-sort]):not(:has(input[type="checkbox"])):hover {
  color: #3b82f6;
}

.rei-table th:not(.no-sort):not([data-no-sort]):not(:has(input[type="checkbox"]))::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: var(--rei-muted);
  opacity: 0.35;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4'/%3E%3Cpath d='M17 20V4'/%3E%3Cpath d='m3 8 4-4 4 4'/%3E%3Cpath d='M7 4v16'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21 16-4 4-4-4'/%3E%3Cpath d='M17 20V4'/%3E%3Cpath d='m3 8 4-4 4 4'/%3E%3Cpath d='M7 4v16'/%3E%3C/svg%3E") no-repeat center / contain;
  transition: opacity 0.15s ease, background-color 0.15s ease;
  pointer-events: none;
}

.rei-table th:not(.no-sort):not([data-no-sort]):not(:has(input[type="checkbox"])):hover::after {
  opacity: 0.95;
  background-color: #3b82f6;
}

.rei-table th[data-sort-dir="asc"] {
  color: #3b82f6 !important;
}

.rei-table th[data-sort-dir="asc"]::after {
  opacity: 1 !important;
  background-color: #3b82f6 !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3Cpath d='M12 19V5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 7-7 7 7'/%3E%3Cpath d='M12 19V5'/%3E%3C/svg%3E") no-repeat center / contain;
}

.rei-table th[data-sort-dir="desc"] {
  color: #3b82f6 !important;
}

.rei-table th[data-sort-dir="desc"]::after {
  opacity: 1 !important;
  background-color: #3b82f6 !important;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='m19 12-7 7-7-7'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14'/%3E%3Cpath d='m19 12-7 7-7-7'/%3E%3C/svg%3E") no-repeat center / contain;
}

.rei-table th.no-sort,
.rei-table th[data-no-sort],
.rei-table th:has(input[type="checkbox"]) {
  cursor: default !important;
  padding-right: 14px !important;
}

.rei-table th.no-sort::after,
.rei-table th[data-no-sort]::after,
.rei-table th:has(input[type="checkbox"])::after {
  display: none !important;
}
.rei-table :where(th, td) {
  padding: 0 14px;
  border-bottom: 1px solid var(--rei-border);
}
.rei-table td {
  height: var(--rei-row-height);
}
.rei-table tr:last-child td { border-bottom: 0; }
.rei-table tbody tr:hover { background: var(--rei-hover); }
.rei-table tbody tr[aria-selected="true"] { background: var(--rei-hover); }

/* Balance page: vendor and bank tables stack when two 480px cards no longer fit */
.rei-balance-tables {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr));
  gap: 16px;
  margin-bottom: 20px;
}
.rei-balance-tables .rei-table td:first-child {
  white-space: normal;
  overflow-wrap: anywhere;
}

.rei-contact-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--rei-text);
  text-align: left;
  cursor: pointer;
}
.rei-contact-name {
  font-weight: 600;
  font-size: 12px;
  line-height: 1.35;
}
.rei-contact-sub {
  color: var(--rei-faint);
  font-size: 11px;
}

/* Follow-up Tick Button */
.rei-tick-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  border: 0;
  background: var(--rei-hover);
  color: var(--rei-muted);
  cursor: pointer;
  transition: all 0.12s;
}
.rei-tick-btn:hover {
  background: var(--rei-selected);
  color: var(--rei-text);
}
.rei-tick-btn.ticked {
  background: var(--rei-success-bg);
  border: 0;
  color: var(--rei-success);
  font-weight: 600;
}

/* Right Detail Card (rei-detail) */
.rei-detail {
  display: block !important;
  width: 312px;
  min-width: 312px;
  margin-left: 18px;
  flex-shrink: 0;
  background: var(--rei-surface);
  border: 1px solid var(--rei-border);
  border-radius: 10px;
  overflow: hidden;
  position: sticky;
  top: 0;
  opacity: 1;
  visibility: visible;
  transition:
    width 235ms var(--spring),
    min-width 235ms var(--spring),
    margin-left 235ms var(--spring),
    opacity 170ms ease,
    border-color 180ms ease,
    visibility 0ms linear 0ms;
}
/* It stays laid out while closed. Its border and height go too, so a closed card takes no room beside the page or below it. The height goes once the close has finished. */
.rei-detail[hidden] {
  width: 0px;
  min-width: 0px;
  height: 0px;
  margin-left: 0px;
  border-width: 0;
  opacity: 0;
  border-color: transparent;
  visibility: hidden;
  pointer-events: none;
  interactivity: inert;
  transition:
    width 225ms var(--spring),
    min-width 225ms var(--spring),
    margin-left 225ms var(--spring),
    opacity 150ms ease,
    border-color 150ms ease,
    visibility 0ms linear 225ms,
    height 0ms linear 225ms allow-discrete,
    border-width 0ms linear 225ms;
}
/* The contents keep their full width, so nothing re-wraps while the card opens or closes. */
.rei-detail > * {
  width: 310px;
  min-width: 310px;
  opacity: 1;
  transform: translateX(0) translateY(0);
  transition: opacity 175ms var(--spring), transform 225ms var(--spring);
}
.rei-detail[hidden] > * {
  opacity: 0;
  transform: translateX(18px);
}
/* Two-phase cross-fade when clicking from Client A to Client B */
.rei-detail.is-switching > * {
  opacity: 0.35;
  transform: translateY(4px);
  transition: opacity 85ms ease, transform 85ms ease;
}
/* On a page without the side column the card keeps its old place: below the page, full width. */
.rei-data-layout:not(.with-detail):has(> .rei-detail:not([hidden])) {
  flex-wrap: wrap;
}
.rei-data-layout:not(.with-detail):has(> .rei-detail:not([hidden])) > #mainViewport {
  flex-basis: 100%;
}
.rei-data-layout:not(.with-detail) > .rei-detail:not([hidden]) {
  width: 100%;
  min-width: 0;
  margin-left: 0;
}
.rei-data-layout:not(.with-detail) > .rei-detail:not([hidden]) > * {
  width: auto;
}
.rei-detail-top {
  padding: 16px 18px;
}
.rei-detail-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 8px 0 2px;
}
.rei-detail-section {
  border-top: 1px solid var(--rei-border);
  padding: 14px 18px;
}
.rei-properties {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px 8px;
  margin: 10px 0 0;
  font-size: 12px;
}
.rei-properties dt { color: var(--rei-faint); }
.rei-properties dd { margin: 0; font-weight: 500; }

/* Peak Time Heatmap */
.heatmap-grid {
  display: grid;
  grid-template-columns: 42px repeat(24, minmax(24px, 1fr));
  gap: 3px;
  min-width: 680px;
}
.heatmap-hour {
  font-size: 11px;
  color: var(--rei-faint);
  text-align: center;
  padding-bottom: 3px;
}
.heatmap-day {
  font-size: 11px;
  color: var(--rei-muted);
  display: flex;
  align-items: center;
}
.heatmap-cell {
  height: 26px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.1s;
}
.heatmap-cell:hover {
  transform: scale(1.12);
  z-index: 3;
  outline: 1px solid var(--rei-text);
}

/* Sign-in screen. Solid, so nothing behind it can be read until someone has signed in. */
.rei-auth-screen {
  --login-bg: #f6f8f7;
  --login-card-bg: rgba(255, 255, 255, 0.82);
  --login-elevated: #eef2f1;
  --login-autofill-bg: #eef2f1;
  --login-focus-bg: #ffffff;
  --login-hover: #e4eae8;
  --login-border: rgba(13, 13, 13, 0.09);
  --login-border-strong: rgba(13, 13, 13, 0.16);
  --login-text: #0d0d0d;
  --login-text-sub: #5d5d5d;
  --login-muted: #828886;
  --login-btn-bg: #63c5b8;
  --login-btn-hover: #52b5a8;
  --login-btn-text: #081c19;
  --login-shadow: 0 28px 70px rgba(15, 23, 42, 0.10), 0 4px 16px rgba(15, 23, 42, 0.05);
  --login-btn-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  --grid-line: rgba(13, 13, 13, 0.035);
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  padding: 24px;
  overflow: auto;
  background: var(--login-bg);
  color: var(--login-text);
  font-family: 'Satoshi', -apple-system, BlinkMacSystemFont, sans-serif;
  transition: background 0.3s ease;
}
[data-rei-theme="dark"] .rei-auth-screen {
  --login-bg: #0c0e0e;
  --login-card-bg: rgba(22, 24, 24, 0.76);
  --login-elevated: #1c2020;
  --login-autofill-bg: #1c2020;
  --login-focus-bg: #151818;
  --login-hover: #262b2b;
  --login-border: transparent;
  --login-border-strong: transparent;
  --login-text: #f0f4f3;
  --login-text-sub: #b0b8b6;
  --login-muted: #788280;
  --login-btn-bg: #7ec7bc;
  --login-btn-hover: #63c5b8;
  --login-btn-text: #071917;
  --login-shadow: 0 32px 80px rgba(0, 0, 0, 0.65);
  --login-btn-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
  --grid-line: rgba(255, 255, 255, 0.03);
}
.rei-auth-screen[hidden] { display: none; }
.login-bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.login-bg-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image:
    linear-gradient(to right, var(--grid-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
  -webkit-mask-image: radial-gradient(circle at center, black 35%, transparent 85%);
}
#loginBgCanvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}
.login-mouse-glow {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 680px;
  height: 680px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99, 197, 184, 0.14) 0%, rgba(99, 197, 184, 0.04) 40%, transparent 70%);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.rei-auth-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 356px;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 28px 34px;
  border: 1px solid var(--login-border);
  border-radius: 26px;
  background: var(--login-card-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  color: var(--login-text);
  text-align: center;
  box-shadow: var(--login-shadow);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.rei-auth-card:hover { border-color: var(--login-border-strong); }
.login-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  margin-bottom: 10px;
}
.login-crm-mark {
  display: block;
  width: 48px;
  height: 54px;
  color: var(--login-text);
}
.rei-auth-title {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 0 0 28px;
  color: var(--login-text);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo-word-rei { font-weight: 400; letter-spacing: -0.01em; }
.logo-word-crm { font-weight: 800; letter-spacing: -0.025em; }
.rei-auth-message {
  width: 100%;
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(239, 68, 68, 0.38);
  border-radius: 12px;
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}
[data-rei-theme="dark"] .rei-auth-message { color: #f87171; }
.rei-auth-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  width: 100%;
}
.rei-auth-form[hidden], .rei-auth-message[hidden], #authLoading[hidden] { display: none; }
.login-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.login-field input {
  width: 100%;
  height: 45px;
  padding: 0 38px;
  border: 1px solid var(--login-border);
  border-radius: 14px;
  outline: none;
  background: var(--login-elevated);
  color: var(--login-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.login-field input::placeholder {
  color: var(--login-muted);
  font-weight: 500;
  text-align: center;
}
.login-field input:focus {
  border-color: #63c5b8;
  background: var(--login-focus-bg);
  box-shadow: 0 0 0 3px rgba(99, 197, 184, 0.20);
}
/* Chrome and Edge paint a saved password's box white or blue. This keeps the box's own colour. */
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--login-autofill-bg) inset !important;
  -webkit-text-fill-color: var(--login-text) !important;
  caret-color: var(--login-text) !important;
  border: 1px solid var(--login-border-strong) !important;
  transition: background-color 9999s ease-out 0s;
}
.login-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--login-focus-bg) inset, 0 0 0 3px rgba(99, 197, 184, 0.20) !important;
  -webkit-text-fill-color: var(--login-text) !important;
  caret-color: var(--login-text) !important;
  border-color: #63c5b8 !important;
}
.login-pass-eye {
  position: absolute;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--login-muted);
  cursor: pointer;
}
.login-pass-eye:hover {
  background: var(--login-hover);
  color: var(--login-text);
}
.login-submit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 45px;
  margin-top: 5px;
  border: none;
  border-radius: 14px;
  background: var(--login-btn-bg);
  color: var(--login-btn-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(99, 197, 184, 0.24);
  transition: background 0.16s ease, transform 0.1s ease, box-shadow 0.16s ease;
}
.login-submit-btn:hover {
  background: var(--login-btn-hover);
  box-shadow: 0 6px 22px rgba(99, 197, 184, 0.34);
}
.login-submit-btn:active { transform: scale(0.99); }
.login-cancel-btn {
  margin-top: 2px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--login-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.login-cancel-btn:hover { color: var(--login-text); }
.login-theme-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--login-border);
  border-radius: 11px;
  background: var(--login-card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--login-text-sub);
  cursor: pointer;
  box-shadow: var(--login-btn-shadow);
  transition: all 0.14s ease;
}
.login-theme-btn:hover {
  border-color: var(--login-border-strong);
  background: var(--login-hover);
  color: var(--login-text);
}

/* Dialog / Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  interactivity: inert;
  transition: opacity 165ms ease, display 195ms allow-discrete;
}
.modal-backdrop.open {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  interactivity: auto;
}
@starting-style {
  .modal-backdrop.open { opacity: 0; }
  .modal-backdrop.open .rei-dialog-card {
    opacity: 0;
    transform: translateY(10px) scale(0.955);
  }
}

.rei-dialog-card {
  width: min(680px, calc(100vw - 48px));
  border: 1px solid var(--rei-border);
  border-radius: 14px;
  padding: 24px;
  background: var(--rei-raised);
  color: var(--rei-text);
  box-shadow: var(--rei-shadow-modal);
  max-height: 92vh;
  overflow-y: auto;
  transition: opacity 155ms ease, transform 195ms var(--pop-spring);
}
.modal-backdrop:not(.open) .rei-dialog-card {
  opacity: 0;
  transform: translateY(10px) scale(0.955);
}
/* The main dialog is emptied the moment it closes. A copy with no names or ids fades out in its place. */
.modal-backdrop:not(.open) #modalContent {
  display: none;
}
.modal-backdrop .rei-dialog-card--closing {
  pointer-events: none;
  transition: none;
  animation: reiDialogCardOut 195ms var(--pop-spring) forwards, reiDialogCardFade 155ms ease forwards;
}
.modal-backdrop.open .rei-dialog-card--closing {
  display: none;
}
@keyframes reiDialogCardOut {
  from { transform: none; }
  to { transform: translateY(10px) scale(0.955); }
}
@keyframes reiDialogCardFade {
  from { opacity: 1; }
  to { opacity: 0; }
}

.rei-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 16px;
  background: var(--rei-pop-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: var(--rei-text);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--rei-shadow-pop);
  z-index: 200;
  width: max-content;
  max-width: min(720px, calc(100vw - 32px));
  max-height: 60vh;
  overflow-y: auto;
  white-space: pre-line;
  transition: opacity 165ms ease, transform 200ms var(--pop-spring), display 200ms allow-discrete;
}
.rei-toast[hidden] {
  opacity: 0;
  transform: translate(-50%, 14px) scale(0.96);
  pointer-events: none;
}
@starting-style {
  .rei-toast:not([hidden]) {
    opacity: 0;
    transform: translate(-50%, 14px) scale(0.96);
  }
}

.rei-toast--stay {
  cursor: pointer;
}

.rei-toast--stay::after {
  content: 'Click to close';
  display: block;
  margin-top: 6px;
  opacity: 0.75;
}

/* 3-Layer Inquiry Tag Pills & VIP Tier Progress Bar */
.rei-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.rei-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 0;
  background: var(--rei-hover);
  color: var(--rei-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.rei-tag-chip:hover {
  background: var(--rei-selected);
  color: var(--rei-text);
}
.rei-tag-chip.active {
  background: var(--rei-selected);
  color: var(--rei-text);
  font-weight: 600;
}
.rei-tag-pill-ro {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  border: 0;
  background: var(--rei-hover);
  color: var(--rei-muted);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.rei-tier-track {
  width: 100%;
  height: 5px;
  border-radius: 99px;
  background: var(--rei-hover);
  overflow: hidden;
  margin-top: 4px;
}
.rei-tier-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--rei-violet);
  transition: width 0.25s ease;
}

/* Custom Date Range Popover */
.rei-daterange-btn {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--rei-border);
  background: var(--rei-bg);
  color: var(--rei-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
  text-align: left;
  white-space: nowrap;
}
.rei-daterange-btn:hover,
.rei-daterange-btn.popover-open {
  border-color: var(--rei-border-strong);
  background: var(--rei-fill-hover);
}
.rei-daterange-btn-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rei-daterange-btn svg {
  width: 14px;
  height: 14px;
  color: var(--rei-muted);
  flex-shrink: 0;
}
/* The small down arrow has no colour of its own and paints black, which vanishes on the dark surface. */
.rei-theme[data-rei-theme="dark"] .rei-daterange-btn > svg {
  fill: currentColor;
}
.rei-daterange-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  color: var(--rei-faint);
  font-size: 11px;
  line-height: 1;
}
.rei-daterange-clear:hover {
  background: var(--rei-border);
  color: var(--rei-text);
}

.rei-daterange-popover {
  position: fixed;
  z-index: 160;
  display: flex;
  background: var(--rei-pop-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--rei-border-strong);
  border-radius: 12px;
  box-shadow: var(--rei-shadow-pop);
  color: var(--rei-text);
  overflow: hidden;
  user-select: none;
}
.rei-daterange-popover {
  display: flex !important;
  transform-origin: top left;
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  will-change: transform, opacity;
  transition: opacity 150ms var(--pop-spring), transform 185ms var(--pop-spring), visibility 0ms linear 0ms;
}
.rei-daterange-popover[hidden] {
  opacity: 0;
  visibility: hidden;
  transform: translateY(var(--pop-y, -7px)) scale(0.96);
  pointer-events: none;
  interactivity: inert;
  transition: opacity 140ms ease, transform 170ms var(--pop-spring), visibility 0ms linear 170ms;
}
@keyframes reiCalSlideNext {
  from { opacity: 0; transform: translateX(10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes reiCalSlidePrev {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes reiCalModeZoom {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.rei-drp-grid.is-slide-next,
.rei-drp-month-label.is-slide-next,
.rei-myp-grid.is-slide-next {
  animation: reiCalSlideNext 155ms var(--pop-spring) both;
}
.rei-drp-grid.is-slide-prev,
.rei-drp-month-label.is-slide-prev,
.rei-myp-grid.is-slide-prev {
  animation: reiCalSlidePrev 155ms var(--pop-spring) both;
}
.rei-myp-grid.is-mode-zoom {
  animation: reiCalModeZoom 155ms var(--pop-spring) both;
}

.rei-drp-presets {
  width: 144px;
  padding: 10px 8px;
  border-right: 1px solid var(--rei-border);
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--rei-bg);
}
.rei-drp-preset-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--rei-faint);
  padding: 2px 8px 6px;
}
.rei-drp-preset-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--rei-muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.rei-drp-preset-btn:hover {
  background: var(--rei-hover);
  color: var(--rei-text);
}
.rei-drp-preset-btn.active {
  background: var(--rei-selected);
  color: var(--rei-text);
  font-weight: 600;
}

.rei-drp-calendar {
  padding: 12px 14px 12px;
  width: 268px;
}
.rei-drp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.rei-drp-month-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--rei-text);
  letter-spacing: -0.01em;
}
.rei-drp-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid var(--rei-border);
  background: var(--rei-fill);
  color: var(--rei-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}
.rei-drp-nav-btn:hover {
  background: var(--rei-hover);
  color: var(--rei-text);
}
.rei-drp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.rei-drp-weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--rei-faint);
  padding: 3px 0;
}
.rei-drp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  row-gap: 3px;
}
.rei-drp-day {
  position: relative;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--rei-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  transition: background 0.1s ease, color 0.1s ease;
}
.rei-drp-day:hover:not(.is-endpoint) {
  background: var(--rei-hover);
  color: var(--rei-text);
}
.rei-drp-day.is-outside {
  color: var(--rei-faint);
}
.rei-drp-day.in-range {
  background: var(--rei-selected);
  color: var(--rei-text);
  border-radius: 0;
}
.rei-drp-day.in-range-start {
  border-top-left-radius: 7px;
  border-bottom-left-radius: 7px;
}
.rei-drp-day.in-range-end {
  border-top-right-radius: 7px;
  border-bottom-right-radius: 7px;
}
.rei-drp-day.is-endpoint {
  background: var(--rei-primary) !important;
  color: var(--rei-on-primary) !important;
  font-weight: 700;
  border-radius: 7px !important;
  z-index: 2;
}
.rei-drp-footer {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--rei-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--rei-muted);
}

/* Affiliate Carryforward Hover Breakdown Popover & Downline Tree */
.rei-cf-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.rei-cf-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  width: 310px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--rei-raised);
  border: 1px solid var(--rei-border-strong);
  box-shadow: var(--rei-shadow);
  color: var(--rei-text);
  font-size: 12px;
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: normal;
}
.rei-cf-pill:hover .rei-cf-tooltip {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.rei-cf-tooltip__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--rei-muted);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rei-border);
}
.rei-cf-tooltip__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
  font-variant-numeric: tabular-nums;
}
.rei-cf-tooltip__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid var(--rei-border);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.rei-cf-tooltip__hint {
  margin-top: 5px;
  font-size: 11px;
  color: var(--rei-faint);
}

/* Visual Stage 1 & Stage 2 Downline Tree */
.rei-tree-root {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rei-tree-node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--rei-border);
  border-radius: 8px;
  background: var(--rei-fill);
}
.rei-tree-node--upline {
  background: var(--rei-bg);
  border-color: var(--rei-border-strong);
}
.rei-tree-branch {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 18px;
  border-left: 1px dashed var(--rei-tree-line, var(--rei-border-strong));
  margin-left: 12px;
}
.rei-tree-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rei-tree-subbranch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-left: 20px;
  border-left: 1px dashed var(--rei-tree-line, var(--rei-border));
  margin-left: 14px;
}
.rei-tree-node--sub {
  background: var(--rei-bg);
}

/* ============================================================================
   MONTH & YEAR PICKER POPOVER (.rei-myp-*)
   ============================================================================ */
.rei-myp-wrap {
  padding: 12px 14px;
  width: 248px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rei-myp-year-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #fafafa;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.rei-myp-year-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}
.rei-myp-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.rei-myp-cell {
  position: relative;
  height: 36px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  color: #e4e4e7;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background 100ms ease, border-color 100ms ease, color 100ms ease;
}
.rei-myp-cell:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.rei-myp-cell.is-active {
  background: #fafafa;
  color: #09090b;
  border-color: #fafafa;
  font-weight: 700;
}
.rei-myp-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: #22c55e;
  flex-shrink: 0;
}
.rei-myp-cell.is-active .rei-myp-dot {
  background: #16a34a;
}

body.theme-light .rei-myp-year-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.14);
  color: #18181b;
}
body.theme-light .rei-myp-year-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}
body.theme-light .rei-myp-cell {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: #27272a;
}
body.theme-light .rei-myp-cell:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.18);
  color: #09090b;
}
body.theme-light .rei-myp-cell.is-active {
  background: #18181b;
  color: #fafafa;
  border-color: #18181b;
}

/* ==========================================================================
   TRANSACTIONS DESK: LIVE GAME & BANK WHOLE-BOX HIGHLIGHT ON UPDATE (NO BORDER)
   ========================================================================== */
.rei-balance-box {
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  transition: background 180ms ease;
  position: relative;
}

[data-rei-theme="light"] .rei-balance-box {
  background: rgba(0, 0, 0, 0.035);
}

.rei-balance-box--updated {
  background: rgba(234, 179, 8, 0.22) !important;
  border: none !important;
  box-shadow: none !important;
}

.rei-balance-box--updated .rei-balance-name {
  color: #fde047 !important;
  font-weight: 700 !important;
}

.rei-balance-box--updated .rei-balance-val {
  color: #fef9c3 !important;
}

[data-rei-theme="light"] .rei-balance-box--updated {
  background: #fef08a !important;
  border: none !important;
  box-shadow: none !important;
}

[data-rei-theme="light"] .rei-balance-box--updated .rei-balance-name {
  color: #854d0e !important;
}

[data-rei-theme="light"] .rei-balance-box--updated .rei-balance-val {
  color: #713f12 !important;
}

/* Cashier Desk Brand Quick-Toggle Bar (No AI glow, sleek pill switcher) */
.rei-txn-brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}

.rei-txn-brand-pills {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--rei-fill);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--rei-border);
}
.rei-pill-glide-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  width: 0;
  transform: translateX(0);
  border-radius: 6px;
  background: var(--rei-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  z-index: 0;
  will-change: transform, width;
  transition: transform 225ms var(--spring), width 225ms var(--spring);
}
.rei-pill-glide-indicator.no-anim {
  transition: none !important;
}
.rei-txn-pill {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--rei-muted);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color 140ms ease, background 120ms ease;
  user-select: none;
}
.rei-txn-pill:hover:not(.active) {
  color: var(--rei-text);
  background: var(--rei-hover);
}
.rei-txn-pill.active {
  color: var(--rei-text);
  font-weight: 600;
}
.rei-txn-brand-pills:not(.has-pill-glide) .rei-txn-pill.active {
  background: var(--rei-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

/* Chrome paints a saved value's box white or blue. In dark this keeps the box's own colour. The sign-in boxes have their own rule above. */
:where(.rei-theme[data-rei-theme="dark"]) .rei-input:-webkit-autofill,
:where(.rei-theme[data-rei-theme="dark"]) .rei-input:-webkit-autofill:hover,
:where(.rei-theme[data-rei-theme="dark"]) .rei-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--rei-surface) inset !important;
  -webkit-text-fill-color: var(--rei-text) !important;
  caret-color: var(--rei-text);
}
/* Chrome's blue fill also runs under the sign-in box's see-through border, and tints the ring. */
:where(.rei-theme[data-rei-theme="dark"]) .login-field input:-webkit-autofill {
  background-clip: padding-box !important;
}

@media (prefers-reduced-motion: reduce) {
  .rei-sidebar,
  .rei-sidebar *,
  .rei-main,
  .rei-data-layout,
  .rei-detail,
  .rei-detail > *,
  .rei-dropdown-popover,
  .rei-daterange-popover,
  .rei-drp-Suggestions,
  .modal-backdrop,
  .rei-dialog-card,
  .rei-toast,
  .rei-tab,
  .rei-tab-glide-indicator,
  .rei-pill-glide-indicator,
  .rei-txn-pill,
  #mainViewport,
  #mainViewport > *,
  .rei-modal-tab-body,
  .rei-drp-grid,
  .rei-drp-month-label,
  .rei-myp-grid,
  .rei-topbar,
  .rei-button {
    transition: none !important;
    animation: none !important;
  }
  .rei-button:active:not(:disabled) {
    transform: none;
  }
  .rei-detail.is-switching > * {
    opacity: 1;
    transform: none;
  }
  .modal-backdrop .rei-dialog-card--closing {
    display: none;
  }
}

/* ==========================================================================
   Dark: no outlines. Surfaces are told apart by fill tone. Light keeps its lines,
   as its white cards on a near-white page would otherwise vanish.
   ========================================================================== */
.rei-table :where(th, td),
.rei-detail-section,
.rei-cf-tooltip__title,
.rei-cf-tooltip__total,
.rei-drp-footer {
  border-color: var(--rei-divider);
}
.rei-theme[data-rei-theme="dark"] {
  --rei-tree-line: rgba(255, 255, 255, 0.18);
}
/* Selected rows, focus and error marks are drawn by their own rules and are not touched. */
.rei-theme[data-rei-theme="dark"] .rei-table th {
  background: var(--rei-surface);
}
.rei-theme[data-rei-theme="dark"] .rei-myp-year-btn,
.rei-theme[data-rei-theme="dark"] .rei-myp-year-btn:hover {
  border-color: transparent;
}
.rei-theme[data-rei-theme="dark"] .rei-myp-cell {
  border-color: transparent;
  background: var(--rei-fill);
}
.rei-theme[data-rei-theme="dark"] .rei-myp-cell:hover:not(.is-active) {
  border-color: transparent;
  background: var(--rei-fill-hover);
}
.rei-theme[data-rei-theme="dark"] .rei-copy-btn:not(.rei-copy-btn--accent) {
  background: var(--rei-fill);
}
.rei-theme[data-rei-theme="dark"] .rei-copy-btn:not(.rei-copy-btn--accent):hover {
  background: var(--rei-fill-hover);
}
.rei-theme[data-rei-theme="dark"] .rei-copy-btn--accent:hover {
  border-color: transparent;
}
.rei-theme[data-rei-theme="dark"] .rei-badge--danger {
  color: #fb7185;
}
.rei-theme[data-rei-theme="dark"] .rei-auth-card:hover {
  border-color: transparent;
}

/* Deposit, Withdrawal and Transfer: the filters in the toolbar. They reuse the date button and the dropdown list. */
.rei-ledger-date {
  flex: 0 0 auto;
}
.rei-ledger-date .rei-daterange-btn {
  width: auto;
  min-width: 158px;
}
.rei-ledger-filter-btn {
  width: auto;
  flex: 0 0 auto;
}
.rei-ledger-filter-btn .rei-pop-count {
  margin-left: 6px;
  padding: 0 5px;
}
.rei-ledger-summary {
  min-height: 18px;
  margin: -6px 0 8px;
  font-size: 12px;
  color: var(--rei-muted);
}
.rei-ledger-note {
  padding: 28px 12px !important;
  text-align: center;
  color: var(--rei-muted);
}
.rei-ledger-loading {
  color: var(--rei-text);
  font-weight: 500;
}
.rei-ledger-pop {
  width: 272px;
  overflow: hidden;
}
.rei-ledger-pop-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.rei-ledger-pop-clear {
  border: 0;
  background: transparent;
  color: var(--rei-muted);
  font: inherit;
  font-size: 11px;
  padding: 1px 4px;
  border-radius: 4px;
  cursor: pointer;
}
.rei-ledger-pop-clear:hover {
  background: var(--rei-hover);
  color: var(--rei-text);
}
.rei-ledger-pop-search {
  flex: 0 0 auto;
  width: auto;
  margin: 0 4px 6px;
}
.rei-ledger-pop-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}
.rei-ledger-opt {
  flex: 0 0 auto;
}
.rei-ledger-opt input[type="checkbox"] {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--rei-accent, #3b82f6);
  cursor: pointer;
}
.rei-ledger-opt-text {
  display: inline-flex;
  flex-direction: column;
  min-width: 0;
}
.rei-ledger-pop-note {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--rei-muted);
}

/* ==========================================================================
   Polish batch (6 Nov 2026). Laid over the rules above: fixed meanings for
   colour, six type sizes, three button sizes with one corner, a visible focus
   ring, quiet empty and loading states, and the finishing touches to motion.
   The owner's approved animations above are left exactly as they are.
   ========================================================================== */
.rei-theme {
  --rei-surface-2: #f4f4f2;
  --rei-accent: var(--rei-focus);
  --rei-font-sans: var(--rei-font);
  --rei-hl: rgba(0, 0, 0, 0.07);
}
.rei-theme[data-rei-theme="dark"] {
  --rei-surface-2: #202024;
  --rei-hl: rgba(255, 255, 255, 0.11);
}

/* Names used by the screens that had no rule of their own */
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}
.rei-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rei-border);
  border-radius: var(--rei-radius-card);
  background: var(--rei-surface);
}
.rei-badge-dot { display: none; }
.rei-badge--neutral,
.rei-badge--pink { background: var(--rei-hover); color: var(--rei-muted); }
.rei-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--rei-muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.rei-icon-btn:hover { background: var(--rei-hover); color: var(--rei-text); }

/* Light: the month and year picker had dark-only colours */
.rei-theme:not([data-rei-theme="dark"]) .rei-myp-year-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.14);
  color: var(--rei-text);
}
.rei-theme:not([data-rei-theme="dark"]) .rei-myp-year-btn:hover { background: rgba(0, 0, 0, 0.08); }
.rei-theme:not([data-rei-theme="dark"]) .rei-myp-cell {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--rei-text);
}
.rei-theme:not([data-rei-theme="dark"]) .rei-myp-cell:hover {
  background: rgba(0, 0, 0, 0.07);
  border-color: rgba(0, 0, 0, 0.18);
  color: var(--rei-text);
}
.rei-theme:not([data-rei-theme="dark"]) .rei-myp-cell.is-active {
  background: var(--rei-primary);
  color: var(--rei-on-primary);
  border-color: var(--rei-primary);
}

/* Type: 11, 12, 13, 14, 18 and 22 only. Labels in sentence case, never forced capitals. */
.rei-eyebrow {
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  color: var(--rei-muted);
}
.rei-pop-header,
.rei-drp-preset-title,
.rei-cf-tooltip__title {
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
}
.rei-kbd { font-size: 11px; }
.rei-label { font-size: 12px; }
.rei-kpi-value { font-size: 22px; }
.rei-detail-name { font-size: 18px; }
.rei-contact-sub { font-size: 11px; }

/* Tables: cells at normal weight, the name a little stronger, dates grey, numbers on the right */
.rei-table tbody td { font-weight: 400; }
.rei-table tbody td[style*="font-weight"],
.rei-table tbody td [style*="font-weight"] { font-weight: 500 !important; }
.rei-table tbody td[style*="font-weight"] { font-weight: 400 !important; }
.rei-table tbody td strong,
.rei-table tbody td b,
.rei-contact-name { font-weight: 500; }
.rei-table tfoot td { font-weight: 600; }
.rei-table th.rei-num,
.rei-table td.rei-num {
  text-align: right;
  font-family: var(--rei-font-num);
  font-variant-numeric: tabular-nums;
}
.rei-th-unit {
  color: var(--rei-faint);
  font-weight: 400;
}
.rei-table td.rei-cell-date { color: var(--rei-muted); }
.rei-count,
.rei-badge,
.rei-pop-count { font-variant-numeric: tabular-nums; }

/* Colour has one meaning. Blue is only for focus and the sort mark, so information in blue is plain text. */
.rei-badge--info { background: var(--rei-hover); color: var(--rei-muted); }
.rei-theme [style*="color:var(--rei-info)"],
.rei-theme [style*="color: var(--rei-info)"] { color: var(--rei-text) !important; }

/* Buttons: 32, 28 and 22 high, one corner, no green or red bars */
.rei-button { border-radius: 6px; }
.rei-button--sm { min-height: 28px; font-size: 12px; }
.rei-copy-btn {
  min-height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}
.rei-input, .rei-select, .rei-textarea,
.rei-daterange-btn,
.brand-toggle-btn,
.rei-pop-item,
.rei-drp-preset-btn,
.rei-drp-day,
.rei-drp-day.in-range-start,
.rei-drp-day.in-range-end { border-radius: 6px; }
.rei-button:disabled,
.rei-button[disabled] { opacity: 0.45; cursor: not-allowed; }
.rei-button--success,
.rei-theme[data-rei-theme="dark"] .rei-button--success {
  color: var(--rei-on-primary);
  background: var(--rei-primary);
  border-color: var(--rei-primary);
  font-weight: 500;
}
.rei-button--success:hover:not(:disabled),
.rei-theme[data-rei-theme="dark"] .rei-button--success:hover:not(:disabled) {
  color: var(--rei-on-primary);
  background: var(--rei-primary);
  border-color: var(--rei-primary);
  filter: brightness(0.92);
}
.rei-button--sm.rei-button--success,
.rei-theme[data-rei-theme="dark"] .rei-button--sm.rei-button--success {
  color: var(--rei-text);
  background: var(--rei-selected);
  border-color: transparent;
}
.rei-button--danger,
.rei-theme[data-rei-theme="dark"] .rei-button--danger {
  color: var(--rei-danger);
  background: var(--rei-danger-bg);
  border-color: transparent;
  font-weight: 500;
}
.rei-button--danger:hover:not(:disabled),
.rei-theme[data-rei-theme="dark"] .rei-button--danger:hover:not(:disabled) {
  color: var(--rei-danger);
  background: color-mix(in srgb, var(--rei-danger) 22%, transparent);
  border-color: transparent;
  filter: none;
}
.rei-theme[data-rei-theme="dark"] .rei-button--danger,
.rei-theme[data-rei-theme="dark"] .rei-button--danger:hover:not(:disabled) { color: #fb7185; }
/* The confirm button of each desk form sits at the end of the form, not across its whole width. */
form[onsubmit*="submitNewTxn"] > button[type="submit"] {
  justify-self: end;
  min-width: 168px;
}

/* Keyboard focus shows a clear ring. A mouse click does not. */
.rei-theme :focus-visible {
  outline: 2px solid var(--rei-focus);
  outline-offset: 2px;
}
.rei-theme .rei-input:focus-visible,
.rei-theme .rei-select:focus-visible,
.rei-theme .rei-textarea:focus-visible {
  outline-offset: 0;
}
.rei-theme .login-field input:focus-visible { outline: none; }

/* One quiet line in place of a big coloured box */
.rei-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 4px 6px 4px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--rei-border);
  border-radius: var(--rei-radius-card);
  background: var(--rei-surface);
  color: var(--rei-muted);
  font-size: 13px;
}
.rei-notice strong { color: var(--rei-text); font-weight: 500; }
.rei-notice-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--rei-warning);
}
.rei-notice-act { margin-left: auto; }

/* Empty lists: an icon, one line and a hint */
.rei-empty { color: var(--rei-muted); white-space: normal; }
.rei-empty::before {
  content: "";
  display: block;
  width: 40px;
  height: 40px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--rei-hover) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e8e93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 12h-6l-2 3h-4l-2-3H2'/%3E%3Cpath d='M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z'/%3E%3C/svg%3E") no-repeat center / 18px;
}
.rei-empty strong { display: block; color: var(--rei-text); font-weight: 500; font-size: 14px; }
.rei-empty-hint { display: block; margin-top: 4px; font-size: 12px; color: var(--rei-faint); }

/* Loading: grey bars with a quiet shimmer, the height of real rows */
.rei-skeleton { padding: 4px 0 8px; }
.rei-skeleton-words { margin: 0; padding: 8px 16px; font-size: 12px; color: var(--rei-faint); }
.rei-skeleton-row {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--rei-row-height);
  padding: 0 16px;
  border-top: 1px solid var(--rei-divider);
}
.rei-sk {
  display: block;
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--rei-hover) 0%, var(--rei-selected) 50%, var(--rei-hover) 100%);
  background-size: 200% 100%;
  animation: reiShimmer 1.6s ease-in-out infinite;
}
@keyframes reiShimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

/* Table width jump after a tab click: the page keeps room for its scroll bar, so a page that grows taller does not get narrower. */
.rei-content { scrollbar-gutter: stable; }

/* Toasts carry a tick, or an alert mark */
.rei-toast {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 500;
}
.rei-toast[hidden] { display: none; }
.rei-toast::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  background-color: var(--rei-success);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 4 4L19 6'/%3E%3C/svg%3E") no-repeat center / contain;
}
.rei-toast[data-kind="bad"]::before {
  background-color: var(--rei-warning);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 21h20L12 3Z'/%3E%3Cpath d='M12 10v5M12 18h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 2 21h20L12 3Z'/%3E%3Cpath d='M12 10v5M12 18h.01'/%3E%3C/svg%3E");
}
.rei-toast--stay::after { flex-basis: 100%; padding-left: 24px; margin-top: 0; }

/* A button that is saving says so, with a small spinner, and cannot be pressed twice */
.rei-button[aria-busy="true"] { pointer-events: none; cursor: progress; }
.rei-spin {
  display: inline-block;
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  opacity: 0.8;
  animation: reiSpin 700ms linear infinite;
}
@keyframes reiSpin { to { transform: rotate(360deg); } }

/* A slip just saved, and a figure that changed on reload, glow softly for 1.2 seconds */
@keyframes reiSoftGlow {
  0%, 35% { background-color: var(--rei-hl); }
  100% { background-color: transparent; }
}
.rei-table tbody tr.is-new > td { animation: reiSoftGlow 1200ms ease-out both; }
.rei-kpi-value.is-changed {
  border-radius: 4px;
  margin-left: -4px;
  margin-right: -4px;
  padding: 0 4px;
  animation: reiSoftGlow 1200ms ease-out both;
}

/* Copy: the button shows a tick for 1.2 seconds */
.rei-copy-btn.is-copied,
.rei-button.is-copied { color: var(--rei-text) !important; }
.rei-copy-btn.is-copied svg,
.rei-button.is-copied svg { display: none; }
.rei-copy-btn.is-copied::before,
.rei-button.is-copied::before { content: "✓"; font-weight: 600; }

/* Sidebar: on collapse the words fade first and the width follows 120ms later. Opening is as before. */
.rei-sidebar.is-collapsed { transition: width 220ms var(--spring) 120ms; }
.rei-sidebar.is-collapsed .rei-sidebar-collapse-btn { transition: color 130ms ease, background 130ms ease, left 220ms var(--spring) 120ms; }
.rei-app.is-sidebar-collapsed .rei-topbar { transition: padding-left 180ms var(--spring) 120ms; }
.rei-sidebar.is-collapsed .rei-nav-count { transition: top 220ms var(--spring) 120ms, right 220ms var(--spring) 120ms, background 120ms ease, color 120ms ease, padding 120ms ease; }

@media (prefers-reduced-motion: reduce) {
  .rei-sk,
  .rei-spin,
  .rei-table tbody tr.is-new > td,
  .rei-kpi-value.is-changed,
  .rei-toast,
  .rei-sidebar.is-collapsed,
  .rei-sidebar.is-collapsed .rei-sidebar-collapse-btn,
  .rei-app.is-sidebar-collapsed .rei-topbar,
  .rei-sidebar.is-collapsed .rei-nav-count,
  .rei-notice,
  .rei-icon-btn {
    transition: none !important;
    animation: none !important;
  }
}

/* ===== Table comfort and quick jump (6 Nov 2026, owner asked) ===== */
/* Wide tables still scroll sideways inside their box, but the client column (and Pick / Rank before it) stays on screen. */
.rei-table th.rei-pin, .rei-table td.rei-pin { position: sticky; z-index: 1; background: var(--rei-surface); }
.rei-table th.rei-pin { z-index: 2; background: var(--rei-bg); }
.rei-table tbody tr:hover td.rei-pin,
.rei-table tbody tr[aria-selected="true"] td.rei-pin { background: linear-gradient(var(--rei-hover), var(--rei-hover)), var(--rei-surface); }
.rei-table .rei-pin-edge { box-shadow: inset -1px 0 0 var(--rei-border); }
.rei-table-shell.is-scrolled-x .rei-pin-edge { box-shadow: inset -1px 0 0 var(--rei-border-strong), 6px 0 8px -6px rgba(0, 0, 0, .3); }

/* Calm cells: one main figure, the detail in grey under it; tags stay on one line. */
.rei-table .rei-tag-group { flex-wrap: nowrap; }
.rei-cell-main { display: block; }
.rei-cell-sub { display: block; margin-top: 2px; font-size: 11px; font-weight: 400; color: var(--rei-muted); white-space: nowrap; }
.rei-table td:has(.rei-cell-sub) { padding-top: 7px; padding-bottom: 7px; }
.rei-tag-more { align-self: center; font-size: 11px; color: var(--rei-faint); white-space: nowrap; }

/* Quick jump in the top bar */
.rei-jump { position: relative; margin-right: 8px; }
.rei-jump-box {
  display: flex; align-items: center; gap: 8px;
  width: min(340px, 34vw); height: 32px; padding: 0 8px 0 10px;
  border: 1px solid var(--rei-border); border-radius: 8px; background: var(--rei-surface);
  color: var(--rei-faint); cursor: text;
  transition: border-color 120ms ease-out, box-shadow 120ms ease-out;
}
.rei-jump-box:focus-within { border-color: var(--rei-focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rei-focus) 22%, transparent); }
.rei-jump-box .rei-icon { width: 14px; height: 14px; }
.rei-jump-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--rei-text); font-size: 13px; }
.rei-jump-box input::placeholder { color: var(--rei-faint); }
.rei-jump-box input::-webkit-search-cancel-button { display: none; }
.rei-jump-box input:focus-visible { outline: none; }
.rei-jump-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 300;
  max-height: 420px; overflow-y: auto;
  padding: 4px; border-radius: 8px; background: var(--rei-pop-bg); box-shadow: var(--rei-shadow-pop);
  -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); border: 1px solid var(--rei-border);
  display: flex !important; flex-direction: column;
  /* Same open and close as the CRM's other pop-ups (owner's approved timings) */
  transform-origin: top left; opacity: 1; visibility: visible; transform: none;
  transition: opacity 150ms var(--pop-spring), transform 180ms var(--pop-spring), visibility 0s;
}
.rei-jump-list[hidden] {
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(-7px) scale(.96);
  transition: opacity 135ms ease, transform 165ms var(--pop-spring), visibility 0s linear 165ms;
}
.rei-jump-head { margin: 6px 8px 4px; font-size: 11px; font-weight: 500; color: var(--rei-faint); }
.rei-jump-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 8px;
  border: 0; border-radius: 6px; background: none; color: var(--rei-text); text-align: left; cursor: pointer; font-size: 13px;
}
.rei-jump-item .rei-icon { color: var(--rei-faint); stroke-width: 1.8; }
.rei-jump-item:hover, .rei-jump-item.is-focus { background: var(--rei-hover); }
.rei-jump-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rei-jump-note { margin-left: auto; color: var(--rei-faint); font-size: 12px; white-space: nowrap; }
.rei-jump-empty { padding: 12px; color: var(--rei-faint); font-size: 12px; }
@media (max-width: 900px) { .rei-jump-box kbd { display: none; } .rei-jump-box { width: 200px; } }
.rei-table tr.rei-row-danger td.rei-pin { background: linear-gradient(var(--rei-danger-bg), var(--rei-danger-bg)), var(--rei-surface); }
/* One date in a form: the CRM's own calendar (days the field does not allow are greyed) */
.rei-datefield-btn { width: 100%; }
.rei-drp-day:disabled { opacity: .35; cursor: not-allowed; }

/* Long money headers: short name, formula in grey under it (owner asked, 6 Nov 2026). */
.rei-table th .rei-cell-sub { font-size: 10.5px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--rei-faint); }
.rei-table th:has(.rei-cell-sub) { padding-top: 6px; padding-bottom: 6px; line-height: 1.25; }
