:root {
  --pink: #cb217f;
  --pink-hot: #f04aa0;
  --green: #209747;
  --green-hot: #39c76d;
  --blue: #2868b8;
  --gold: #c28a16;
  --ink: #151923;
  --ink-2: #202737;
  --muted: #697386;
  --muted-2: #8a96a8;
  --line: rgba(30, 39, 54, 0.12);
  --line-strong: rgba(30, 39, 54, 0.2);
  --paper: #ffffff;
  --paper-soft: #f7f9fc;
  --canvas: #edf1f5;
  --danger: #b42318;
  --radius: 8px;
  --shadow-sm: 0 10px 24px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 20px 48px rgba(15, 23, 42, 0.14);
  --shadow-lg: 0 28px 70px rgba(15, 23, 42, 0.2);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
  font-family: Ubuntu, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(203, 33, 127, 0.1), transparent 26%),
    linear-gradient(45deg, transparent 0, rgba(32, 151, 71, 0.08) 46%, transparent 76%),
    repeating-linear-gradient(90deg, rgba(21, 25, 35, 0.04) 0 1px, transparent 1px 86px),
    repeating-linear-gradient(0deg, rgba(21, 25, 35, 0.035) 0 1px, transparent 1px 86px),
    var(--canvas);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input,
select {
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease,
    color 150ms ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(203, 33, 127, 0.22);
  outline-offset: 2px;
}

.is-hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(460px, 1.06fr) minmax(380px, 0.72fr);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.84)),
    transparent;
}

.brand-panel {
  position: relative;
  min-height: 100vh;
  padding: 58px;
  display: grid;
  align-content: center;
  gap: 30px;
  overflow: hidden;
  color: white;
  background:
    linear-gradient(135deg, rgba(12, 16, 24, 0.2), rgba(12, 16, 24, 0.86)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' x2='1' y1='0' y2='1'%3E%3Cstop stop-color='%23209747'/%3E%3Cstop offset='.48' stop-color='%232868B8'/%3E%3Cstop offset='1' stop-color='%23CB217F'/%3E%3C/linearGradient%3E%3C/defs%3E%3Crect width='1200' height='800' fill='url(%23g)'/%3E%3Cpath d='M0 625 C260 510 390 630 600 500 C800 374 948 344 1200 402 L1200 800 L0 800 Z' fill='%23151923' opacity='.55'/%3E%3Cpath d='M0 138 C190 74 352 126 560 86 C780 44 958 30 1200 88 L1200 0 L0 0 Z' fill='%23ffffff' opacity='.15'/%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.34' stroke-width='3'%3E%3Cpath d='M268 365 L600 170 L932 365 L600 560 Z'/%3E%3Cpath d='M600 170 L600 560'/%3E%3Cpath d='M268 365 L932 365'/%3E%3Cpath d='M414 282 L786 448'/%3E%3Cpath d='M786 282 L414 448'/%3E%3C/g%3E%3Cg fill='%23ffffff' opacity='.12'%3E%3Crect x='128' y='132' width='180' height='2'/%3E%3Crect x='128' y='160' width='118' height='2'/%3E%3Crect x='900' y='616' width='190' height='2'/%3E%3Crect x='974' y='646' width='118' height='2'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.brand-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.08) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.06) 0 1px, transparent 1px 96px);
  pointer-events: none;
}

.brand-panel > * {
  position: relative;
}

.brand-mark {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: white;
  font-size: 34px;
  font-weight: 900;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.02)),
    linear-gradient(135deg, var(--pink), var(--green));
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.28);
}

.brand-mark.small {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-color: rgba(255, 255, 255, 0.22);
  font-size: 23px;
  box-shadow: 0 16px 34px rgba(203, 33, 127, 0.26);
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--pink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.brand-panel .eyebrow {
  color: #ffe4f2;
}

.brand-panel h1 {
  max-width: 820px;
  margin: 0;
  font-size: 52px;
  line-height: 1.02;
  letter-spacing: 0;
}

.brand-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(96px, 1fr));
  gap: 12px;
  max-width: 600px;
}

.brand-metrics div {
  padding: 17px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: var(--radius);
  color: white;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.06));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.22) inset;
  backdrop-filter: blur(18px);
}

.brand-metrics span {
  display: block;
  font-size: 29px;
  font-weight: 900;
}

.brand-metrics small {
  color: rgba(255, 255, 255, 0.78);
  font-weight: 800;
}

.auth-panel {
  width: min(100% - 48px, 500px);
  align-self: center;
  justify-self: center;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 248, 252, 0.88)),
    linear-gradient(135deg, rgba(203, 33, 127, 0.08), rgba(32, 151, 71, 0.06));
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px);
}

.auth-heading {
  margin-bottom: 18px;
}

.auth-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #e9eef5, #f7f9fc);
}

.segment {
  min-height: 43px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 900;
}

.segment.is-active {
  color: var(--ink);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

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

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

label {
  display: grid;
  gap: 7px;
  color: #526072;
  font-size: 13px;
  font-weight: 900;
}

input,
select {
  width: 100%;
  min-width: 0;
  height: 45px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

input:hover,
select:hover {
  border-color: var(--line-strong);
}

input:focus,
select:focus {
  border-color: rgba(203, 33, 127, 0.72);
  outline: 3px solid rgba(203, 33, 127, 0.14);
  box-shadow: 0 0 0 1px rgba(203, 33, 127, 0.1);
}

.primary-action,
.secondary-action,
.ghost-action,
.danger-action,
.table-action {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 0 15px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.primary-action {
  color: white;
  background: linear-gradient(135deg, var(--pink-hot), var(--pink) 52%, #7c154f);
  box-shadow: 0 16px 32px rgba(203, 33, 127, 0.26);
}

.primary-action:hover,
.secondary-action:hover,
.ghost-action:hover,
.table-action:hover {
  transform: translateY(-1px);
}

.primary-action:hover {
  box-shadow: 0 22px 42px rgba(203, 33, 127, 0.32);
}

.secondary-action {
  color: var(--ink);
  border-color: rgba(255, 255, 255, 0.76);
  background: linear-gradient(180deg, #ffffff, #edf2f7);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, var(--shadow-sm);
}

.ghost-action {
  color: #edf3fb;
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.055);
}

.panel .ghost-action,
.position-card .ghost-action {
  color: #596577;
  border-color: var(--line);
  background: linear-gradient(180deg, #ffffff, #f2f5f9);
}

.danger-action {
  color: white;
  background: var(--danger);
}

.table-action {
  min-height: 34px;
  color: var(--pink);
  border-color: rgba(203, 33, 127, 0.2);
  background: linear-gradient(180deg, #fff6fb, #f7e3ef);
}

.primary-action:disabled,
.secondary-action:disabled,
.ghost-action:disabled,
.danger-action:disabled,
.table-action:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 306px;
  padding: 22px 20px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 22px;
  color: white;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 26%),
    linear-gradient(135deg, rgba(203, 33, 127, 0.13), transparent 36%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 54px),
    #0d131d;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 24px 0 50px rgba(13, 19, 29, 0.18);
}

.sidebar-brand {
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand strong,
.session-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.sidebar-brand strong {
  font-size: 17px;
}

.sidebar-brand span,
.session-card span {
  display: block;
  margin-top: 2px;
  color: #9daabc;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  align-content: start;
  gap: 9px;
}

.nav-item {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 13px;
  color: #cad5e3;
  background: transparent;
  text-align: left;
  font-weight: 900;
}

.nav-icon {
  position: relative;
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 2px solid currentColor;
  border-radius: 6px;
  opacity: 0.76;
}

.overview-icon::after,
.board-icon::after,
.referrals-icon::after,
.gifts-icon::after,
.stats-icon::after,
.admin-icon::after {
  content: "";
  position: absolute;
  background: currentColor;
  opacity: 0.9;
}

.overview-icon::after {
  inset: 5px;
  border-radius: 2px;
}

.board-icon::after {
  left: 50%;
  top: 3px;
  width: 2px;
  height: 10px;
  transform: translateX(-50%);
}

.referrals-icon::after {
  left: 4px;
  right: 4px;
  top: 8px;
  height: 2px;
}

.gifts-icon::after {
  left: 8px;
  top: -2px;
  width: 2px;
  height: 20px;
}

.stats-icon::after {
  left: 4px;
  bottom: 4px;
  width: 3px;
  height: 10px;
  box-shadow: 5px -5px 0 currentColor, 10px -2px 0 currentColor;
}

.admin-icon::after {
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.nav-item:hover {
  color: white;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.065);
}

.nav-item.is-active {
  color: white;
  border-color: rgba(255, 255, 255, 0.22);
  background:
    linear-gradient(135deg, rgba(240, 74, 160, 0.94), rgba(40, 104, 184, 0.8) 56%, rgba(32, 151, 71, 0.7)),
    var(--pink);
  box-shadow: 0 18px 34px rgba(203, 33, 127, 0.28);
}

.session-card {
  padding: 14px;
  display: grid;
  gap: 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.035));
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.14) inset;
}

.session-main {
  display: flex;
  align-items: center;
  gap: 11px;
}

.profile-avatar,
.overview-avatar,
.avatar-mini {
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background:
    linear-gradient(135deg, var(--pink), var(--blue) 56%, var(--green));
}

.profile-avatar {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
}

.session-card .ghost-action {
  width: 100%;
}

.workspace {
  min-height: 100vh;
  margin-left: 306px;
  padding: 26px;
}

.topbar {
  min-height: 118px;
  margin-bottom: 18px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: white;
  background:
    linear-gradient(135deg, rgba(240, 74, 160, 0.3), transparent 34%),
    linear-gradient(45deg, transparent 0, rgba(32, 151, 71, 0.2) 58%, rgba(40, 104, 184, 0.2)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.055) 0 1px, transparent 1px 74px),
    #111722;
  box-shadow: var(--shadow-md);
}

.topbar .eyebrow {
  color: #ff9bcf;
}

.topbar h2 {
  margin: 0;
  font-size: 36px;
  line-height: 1.05;
  color: white;
}

.topbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}

.live-chip {
  min-height: 38px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: #d9f8e5;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.live-chip span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green-hot);
  box-shadow: 0 0 0 4px rgba(57, 199, 109, 0.14);
}

.refresh-action {
  min-height: 46px;
}

.refresh-symbol {
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
}

.notice-host {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
}

.notice {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  box-shadow: var(--shadow-sm);
}

.notice.error {
  border-color: #f0b7b2;
  color: var(--danger);
  background: #fff0ef;
}

.notice.success {
  border-color: #b9e2c6;
  color: #12642e;
  background: #e6f5ec;
}

.view-root {
  display: grid;
  gap: 18px;
}

.overview-hero {
  min-height: 150px;
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius);
  color: white;
  background:
    linear-gradient(135deg, rgba(203, 33, 127, 0.35), transparent 44%),
    linear-gradient(45deg, transparent 0, rgba(32, 151, 71, 0.25) 58%, rgba(40, 104, 184, 0.22)),
    #151923;
  box-shadow: var(--shadow-md);
}

.overview-profile {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.overview-avatar {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  border-radius: var(--radius);
  font-size: 22px;
}

.overview-profile span {
  color: #ff9bcf;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overview-profile h3 {
  margin: 4px 0;
  font-size: 26px;
  line-height: 1.1;
}

.overview-profile p,
.overview-status {
  color: #bcc7d5;
}

.overview-status {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}

.overview-status strong {
  color: white;
  font-size: 18px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
}

.metric-card,
.panel,
.position-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.metric-card::before,
.panel::before,
.position-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--pink), var(--green), var(--blue));
  opacity: 0.9;
}

.metric-card {
  min-height: 136px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(245, 248, 252, 0.9)),
    repeating-linear-gradient(135deg, rgba(21, 25, 35, 0.035) 0 1px, transparent 1px 18px);
}

.metric-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 12px;
  font-size: 29px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.metric-mark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(21, 25, 35, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(203, 33, 127, 0.16), rgba(32, 151, 71, 0.12));
}

.metric-card.pink {
  border-color: rgba(203, 33, 127, 0.22);
  background: linear-gradient(145deg, #ffffff, #fdeaf4);
}

.metric-card.green {
  border-color: rgba(32, 151, 71, 0.24);
  background: linear-gradient(145deg, #ffffff, #e7f7ed);
}

.metric-card.gold {
  border-color: rgba(194, 138, 22, 0.28);
  background: linear-gradient(145deg, #ffffff, #fff3cf);
}

.panel {
  padding: 21px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.92)),
    repeating-linear-gradient(135deg, rgba(21, 25, 35, 0.03) 0 1px, transparent 1px 18px);
  box-shadow: var(--shadow-md);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-header h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.18;
}

.panel-header p {
  margin: 6px 0 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.board-panel {
  padding: 0;
  background: #ffffff;
}

.board-panel > .panel-header,
.board-panel > .board-meta {
  margin-left: 22px;
  margin-right: 22px;
}

.board-panel > .panel-header {
  margin-top: 22px;
}

.board-panel > .board-layout {
  margin: 18px 22px 22px;
}

.board-layout {
  display: grid;
  gap: 14px;
}

.board-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.two-column .board-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.board-meta div {
  min-height: 78px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(145deg, #ffffff, #f2f6fb);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.92) inset;
}

.board-meta small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.board-meta strong {
  display: block;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.board-tree {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(142px, 1fr));
  grid-template-areas:
    ". legend legend ."
    "leftBuilder leftBuilder rightBuilder rightBuilder"
    "leftDonor1 leftDonor2 rightDonor1 rightDonor2";
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(203, 33, 127, 0.22), transparent 36%),
    linear-gradient(45deg, transparent 0, rgba(32, 151, 71, 0.17) 56%, rgba(40, 104, 184, 0.18)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 72px),
    #111722;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dual-legend-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 0;
  padding: 14px 16px;
  border: 1px solid rgba(203, 33, 127, 0.24);
  border-left: 3px solid var(--pink);
  background: #fff6fb;
  color: var(--ink);
}

.dual-legend-note span {
  color: var(--muted);
  text-align: right;
}

.notification-list {
  display: grid;
  gap: 8px;
}

.notification-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #fff8fc;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.notification-row.is-read {
  background: var(--surface);
  color: var(--muted);
}

.notification-row span {
  display: grid;
  gap: 4px;
}

.notification-row small,
.notification-row time {
  color: var(--muted);
}

.captcha-container {
  min-height: 65px;
  overflow: hidden;
}

.language-control,
.language-select {
  width: 100%;
}

.language-control {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted-2);
  font-size: 12px;
}

.position-card {
  min-height: 148px;
  padding: 15px;
  display: grid;
  align-content: space-between;
  gap: 13px;
  border-color: rgba(255, 255, 255, 0.22);
  color: white;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.045)),
    rgba(255, 255, 255, 0.035);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
}

.position-card.legend {
  grid-area: legend;
  border-color: rgba(240, 74, 160, 0.62);
  background:
    linear-gradient(145deg, rgba(240, 74, 160, 0.32), rgba(255, 255, 255, 0.06));
}

.position-card.left_builder {
  grid-area: leftBuilder;
  border-color: rgba(57, 199, 109, 0.52);
  background:
    linear-gradient(145deg, rgba(57, 199, 109, 0.26), rgba(255, 255, 255, 0.06));
}

.position-card.right_builder {
  grid-area: rightBuilder;
  border-color: rgba(40, 104, 184, 0.58);
  background:
    linear-gradient(145deg, rgba(40, 104, 184, 0.3), rgba(255, 255, 255, 0.06));
}

.position-card.left_donor_1 {
  grid-area: leftDonor1;
}

.position-card.left_donor_2 {
  grid-area: leftDonor2;
}

.position-card.right_donor_1 {
  grid-area: rightDonor1;
}

.position-card.right_donor_2 {
  grid-area: rightDonor2;
}

.position-card.empty {
  border-style: dashed;
  border-color: rgba(203, 213, 225, 0.26);
  color: #c8d2df;
  background: rgba(255, 255, 255, 0.04);
}

.position-card.empty::before {
  opacity: 0.28;
}

.position-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.slot-label {
  color: #b8c4d3;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.position-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.position-user div {
  min-width: 0;
}

.position-user strong {
  display: block;
  color: white;
  overflow-wrap: anywhere;
}

.position-user small {
  display: block;
  margin-top: 3px;
  color: #b8c4d3;
  overflow-wrap: anywhere;
}

.avatar-mini {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.18);
}

.empty-avatar {
  color: #a7b3c3;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: none;
}

.position-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-pill {
  min-height: 25px;
  width: fit-content;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #596577;
  background: linear-gradient(180deg, #ffffff, #f4f7fb);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.status-pill.ok {
  color: #12642e;
  border-color: #b9e2c6;
  background: #e6f5ec;
}

.status-pill.warn {
  color: #7a4d00;
  border-color: #ead29a;
  background: #fff8e6;
}

.status-pill.danger {
  color: var(--danger);
  border-color: #f0b7b2;
  background: #fff0ef;
}

.status-pill.muted-pill {
  color: #6f7b8d;
  border-color: #d8dee8;
  background: #f1f4f8;
}

.form-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 11px;
  align-items: end;
}

.form-inline button {
  min-width: 138px;
}

.referral-result {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid rgba(203, 33, 127, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(253, 234, 244, 0.96), rgba(255, 255, 255, 0.92));
}

.token-box {
  display: block;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: #526072;
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.table-shell {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff, #f7f9fc);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 14px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(238, 242, 247, 0.74);
}

td {
  color: var(--ink-2);
  font-size: 14px;
}

tbody tr:hover td {
  background: rgba(203, 33, 127, 0.04);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  min-height: 140px;
  padding: 30px;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 1px dashed rgba(105, 115, 134, 0.34);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.84), rgba(244, 247, 251, 0.78));
}

.empty-state strong {
  color: var(--ink);
  font-size: 16px;
}

.empty-state span {
  display: block;
  max-width: 560px;
}

.muted {
  color: var(--muted);
}

@media (max-width: 1180px) {
  .auth-screen,
  .two-column {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 430px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }

  .board-meta {
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    width: 100%;
    min-height: auto;
    grid-template-rows: auto auto auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(116px, 1fr));
  }

  .workspace {
    margin-left: 0;
    padding: 18px;
  }

  .topbar,
  .overview-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-status {
    justify-items: start;
    text-align: left;
  }

  .board-tree {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "legend legend"
      "leftBuilder rightBuilder"
      "leftDonor1 leftDonor2"
      "rightDonor1 rightDonor2";
  }
}

@media (max-width: 620px) {
  .sidebar {
    padding: 14px;
    gap: 12px;
  }

  .sidebar-brand {
    min-height: 46px;
  }

  .nav-item {
    min-height: 42px;
    padding: 0 8px;
    gap: 7px;
    font-size: 12px;
  }

  .nav-icon {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
  }

  .session-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px;
  }

  .session-card .ghost-action {
    min-height: 42px;
  }

  .language-control {
    grid-column: 1 / -1;
    margin-top: 0;
  }
  .auth-panel {
    width: calc(100% - 28px);
    padding: 18px;
  }

  .brand-panel {
    min-height: 370px;
    padding: 30px 18px;
  }

  .brand-panel h1 {
    font-size: 34px;
  }

  .brand-metrics,
  .field-grid,
  .metric-grid,
  .board-meta,
  .form-inline {
    grid-template-columns: 1fr;
  }

  .nav-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .topbar {
    min-height: 0;
    padding: 20px;
  }

  .topbar h2 {
    font-size: 30px;
  }

  .panel,
  .metric-card {
    padding: 16px;
  }

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

  .board-panel > .panel-header,
  .board-panel > .board-meta {
    margin-left: 16px;
    margin-right: 16px;
  }

  .board-panel > .board-layout {
    margin: 16px;
  }

  .board-tree {
    padding: 12px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "legend"
      "leftBuilder"
      "leftDonor1"
      "leftDonor2"
      "rightBuilder"
      "rightDonor1"
      "rightDonor2";
  }

  .position-card {
    min-height: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
  }
}

/* Product shell */
:root {
  --ink: #15171c;
  --ink-2: #23262d;
  --muted: #6f7580;
  --muted-2: #969ca6;
  --line: #e4e6ea;
  --line-strong: #cfd3d9;
  --paper-soft: #f7f7f8;
  --canvas: #f2f3f5;
  --radius: 8px;
  --shadow-sm: 0 1px 2px rgba(18, 20, 24, 0.04), 0 8px 24px rgba(18, 20, 24, 0.04);
  --shadow-md: 0 16px 48px rgba(18, 20, 24, 0.08);
}

body {
  background: var(--canvas);
  overflow-x: clip;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 76px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: white;
  background: rgba(17, 19, 24, 0.96);
  box-shadow: 0 10px 30px rgba(18, 20, 24, 0.1);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(100% - 40px, 1480px);
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 210px;
  align-items: center;
  gap: 20px;
}

.sidebar-brand {
  min-height: 0;
}

.sidebar-brand .brand-mark.small {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 8px;
  font-size: 20px;
  box-shadow: none;
}

.sidebar-brand strong {
  font-size: 15px;
}

.sidebar-brand span {
  color: #7fe2a1;
  font-size: 10px;
}

.nav-list {
  min-width: 0;
  display: flex;
  justify-content: center;
  gap: 4px;
}

.nav-item {
  min-height: 42px;
  gap: 8px;
  padding: 0 13px;
  border-radius: 7px;
  color: #aeb3bd;
  font-size: 13px;
}

.nav-item:hover {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.07);
}

.nav-item.is-active {
  border-color: rgba(255, 255, 255, 0.08);
  background: #292c33;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset;
}

.nav-icon {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
  border-width: 1.5px;
  border-radius: 5px;
}

.account-menu {
  position: relative;
  justify-self: end;
}

.account-trigger {
  height: 48px;
  min-width: 176px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  list-style: none;
}

.account-trigger::-webkit-details-marker {
  display: none;
}

.account-trigger:hover,
.account-menu[open] .account-trigger {
  background: rgba(255, 255, 255, 0.1);
}

.account-trigger .profile-avatar {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 7px;
  font-size: 13px;
}

.account-copy {
  min-width: 0;
  flex: 1;
}

.account-copy > span {
  display: block;
  color: #989faa;
  font-size: 9px;
  font-weight: 800;
}

.account-copy strong {
  display: block;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
}

.chevron {
  width: 7px;
  height: 7px;
  margin-right: 3px;
  border-right: 1.5px solid #9da3ad;
  border-bottom: 1.5px solid #9da3ad;
  transform: rotate(45deg) translateY(-2px);
}

.account-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 260px;
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  box-shadow: var(--shadow-md);
}

.account-popover-head {
  padding: 4px 3px 10px;
  border-bottom: 1px solid var(--line);
}

.account-popover-head span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.account-popover-head strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.account-popover .ghost-action {
  width: 100%;
  border-color: var(--line);
  color: var(--ink);
  background: var(--paper-soft);
}

.account-popover .logout-action {
  color: var(--danger);
}

.workspace {
  width: min(100% - 40px, 1480px);
  min-height: calc(100vh - 76px);
  margin: 0 auto;
  padding: 34px 0 60px;
}

.topbar {
  min-height: 74px;
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.topbar .eyebrow {
  margin-bottom: 5px;
  color: var(--pink);
  font-size: 10px;
}

.topbar h2 {
  color: var(--ink);
  font-size: 32px;
}

.live-chip {
  min-height: 34px;
  border-color: #d9e8de;
  color: #217a42;
  background: #eaf6ee;
}

.refresh-action {
  min-height: 40px;
  border-color: var(--line);
  background: white;
  box-shadow: var(--shadow-sm);
}

.view-root {
  gap: 16px;
}

.overview-hero {
  position: relative;
  min-height: 164px;
  padding: 28px;
  border: 0;
  background: #181b21;
  box-shadow: var(--shadow-md);
}

.overview-hero::after {
  content: "UBUNTU";
  position: absolute;
  right: 24px;
  bottom: -20px;
  color: rgba(255, 255, 255, 0.035);
  font-size: 92px;
  font-weight: 900;
  pointer-events: none;
}

.overview-avatar,
.profile-avatar,
.avatar-mini {
  background: linear-gradient(135deg, #d72c87, #6858c9 52%, #279b65);
}

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

.metric-card,
.panel,
.position-card {
  border-color: var(--line);
  background: white;
  box-shadow: var(--shadow-sm);
}

.metric-card::before,
.panel::before,
.position-card::before {
  display: none;
}

.metric-card {
  min-height: 120px;
  padding: 18px;
  background: white;
}

.metric-card strong {
  font-size: 25px;
}

.panel {
  padding: 24px;
}

.panel-header {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.board-panel {
  padding-top: 24px;
}

.board-layout {
  border-color: var(--line);
  background: #f7f8fa;
}

.position-card {
  border-color: var(--line);
}

.table-shell {
  border-color: var(--line);
}

thead th {
  color: #737985;
  background: #f6f7f8;
}

tbody tr:hover {
  background: #fafafb;
}

@media (max-width: 1180px) {
  .header-inner {
    grid-template-columns: 180px minmax(0, 1fr) 54px;
  }

  .account-trigger {
    min-width: 48px;
    width: 48px;
  }

  .account-copy,
  .account-trigger .chevron {
    display: none;
  }

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

@media (max-width: 900px) {
  .app-header {
    height: 68px;
    backdrop-filter: none;
  }

  .header-inner {
    width: calc(100% - 28px);
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .app-header .nav-list {
    position: fixed;
    z-index: 40;
    left: 12px;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    height: 64px;
    padding: 7px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(20, 22, 27, 0.96);
    box-shadow: 0 20px 50px rgba(18, 20, 24, 0.28);
    backdrop-filter: blur(18px);
  }

  .nav-item {
    min-width: 0;
    min-height: 50px;
    padding: 4px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    font-size: 9px;
  }

  .nav-icon {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }

  .workspace {
    width: calc(100% - 28px);
    min-height: calc(100vh - 68px);
    margin: 0 auto;
    padding: 24px 0 100px;
    overflow: clip;
  }

  .topbar,
  .overview-hero {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 620px) {
  .sidebar-brand > div:last-child span {
    display: none;
  }

  .sidebar-brand strong {
    font-size: 14px;
  }

  .account-popover {
    position: fixed;
    top: 76px;
    right: 14px;
    width: min(290px, calc(100vw - 28px));
  }

  .topbar {
    min-height: 62px;
    padding: 0;
  }

  .topbar h2 {
    font-size: 26px;
  }

  .refresh-label,
  .live-chip {
    display: none;
  }

  .refresh-action {
    width: 42px;
    min-width: 42px;
    padding: 0;
  }

  .overview-hero {
    min-height: 190px;
    padding: 20px;
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-profile p {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .overview-status {
    justify-items: start;
    text-align: left;
  }

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

  .metric-card {
    min-height: 112px;
  }

  .panel {
    padding: 18px;
  }

  .app-header .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    overflow-x: auto;
  }

  .nav-item.admin-only:not(.is-hidden) {
    display: flex;
  }
}
