:root {
  --ink: #18202a;
  --muted: #667085;
  --line: #d9e2ec;
  --paper: #f3f6f9;
  --panel: #ffffff;
  --teal: #147c72;
  --amber: #b56a10;
  --rose: #a33d55;
  --blue: #245c9f;
  --green: #2c7a4b;
  --violet: #6656a8;
  --cyan: #1f9db1;
  --shadow: 0 18px 44px rgba(24, 32, 42, 0.11);
  --soft-shadow: 0 8px 22px rgba(24, 32, 42, 0.08);
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 19% 8%, rgba(20, 124, 114, 0.14), transparent 29%),
    radial-gradient(circle at 82% 4%, rgba(181, 106, 16, 0.13), transparent 27%),
    radial-gradient(circle at 76% 78%, rgba(36, 92, 159, 0.12), transparent 31%),
    linear-gradient(90deg, rgba(20, 124, 114, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 92, 159, 0.045) 1px, transparent 1px),
    linear-gradient(135deg, #f9fbfd 0%, #eef5f6 46%, #f8f2e7 100%);
  background-size: auto, auto, auto, 32px 32px, 32px 32px, auto;
  background-attachment: fixed;
}

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

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(20, 124, 114, 0.38), rgba(17, 24, 32, 0) 32%),
    linear-gradient(135deg, rgba(181, 106, 16, 0.16), transparent 44%),
    linear-gradient(160deg, #0d171d 0%, #172b34 52%, #191923 100%);
  color: #f7fafc;
  padding: 22px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  box-shadow: 18px 0 52px rgba(17, 24, 32, 0.18);
}

.sidebar::before {
  content: "";
  display: block;
  height: 4px;
  margin: -22px -22px 18px;
  background: linear-gradient(90deg, var(--teal), var(--amber), var(--blue));
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.brand-mark {
  width: 42px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #1e9a8a, #d48a24 62%, #245c9f);
  font-size: 24px;
  font-weight: 800;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

.brand strong {
  letter-spacing: 0;
}

.brand span,
.hint,
.eyebrow {
  color: #aab6c5;
  font-size: 12px;
}

.login-box {
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.055));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 18px 36px rgba(0, 0, 0, 0.12);
}

label {
  font-size: 12px;
  color: inherit;
  opacity: 0.85;
}

select,
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

select:focus,
input:focus {
  outline: 0;
  border-color: rgba(20, 124, 114, 0.58);
  box-shadow: 0 0 0 3px rgba(20, 124, 114, 0.12);
}

.primary,
.ghost,
.danger,
.icon-btn {
  border: 0;
  border-radius: 7px;
  padding: 10px 12px;
  cursor: pointer;
  min-height: 40px;
  overflow-wrap: anywhere;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary {
  background: linear-gradient(135deg, var(--teal), #1b8f83 58%, #245c9f);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 18px rgba(20, 124, 114, 0.19);
}

.ghost {
  background: linear-gradient(180deg, #f7fafc, #e8edf3);
  color: #243141;
  border: 1px solid #dbe3ed;
}

.danger {
  background: #fee9ef;
  color: #8c2540;
}

.icon-btn {
  width: 40px;
  padding: 0;
  background: #eef4f8;
}

.primary:hover,
.ghost:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.nav {
  margin-top: 18px;
  display: grid;
  gap: 7px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 11px;
  border-radius: 7px;
  color: #dce5ee;
  background: transparent;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background 0.16s ease, transform 0.16s ease, color 0.16s ease;
}

.nav button span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.nav button.active,
.nav button:hover {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.055));
  box-shadow: inset 3px 0 0 #d48a24, 0 12px 24px rgba(0, 0, 0, 0.12);
  color: #fff;
  transform: translateX(2px);
}

.main {
  padding: 28px;
  min-width: 0;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 38px);
  margin-bottom: 0;
  letter-spacing: 0;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0;
  font-weight: 800;
  margin-bottom: 6px;
}

.session-card {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.session-card span {
  min-width: min(240px, 100%);
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 20px;
  padding: 24px;
  background:
    linear-gradient(120deg, rgba(13, 84, 79, 0.96), rgba(31, 74, 123, 0.92)),
    linear-gradient(45deg, rgba(212, 138, 36, 0.55), transparent 42%);
  color: #fff;
  border-radius: 8px;
  overflow: hidden;
  min-height: 232px;
  margin-bottom: 22px;
  box-shadow: 0 24px 58px rgba(21, 54, 78, 0.24);
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.55;
  pointer-events: none;
}

.hero-panel::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 4px;
  background: linear-gradient(90deg, #36b8a7, #d48a24, #7aa7df);
  border-radius: 999px 999px 0 0;
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
  max-width: 780px;
}

.hero-copy h2 {
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.08;
  margin-bottom: 10px;
}

.hero-copy p:last-child {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 0;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.hero-stats b {
  color: #fff;
}

.hero-visual {
  position: relative;
  z-index: 1;
  min-height: 184px;
}

.orbit {
  position: absolute;
  inset: 17px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
}

.orbit::before {
  content: "";
  position: absolute;
  width: 8px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #f5c25d;
  right: 18%;
  top: 5%;
  box-shadow: 0 0 18px rgba(245, 194, 93, 0.75);
}

.o2 {
  inset: 42px;
}

.o3 {
  inset: 68px;
}

.node {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #eff7f6);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.62);
}

.signal {
  position: absolute;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.82), transparent);
  opacity: 0.75;
}

.s1 {
  width: 44%;
  left: 7%;
  top: 29%;
  transform: rotate(18deg);
}

.s2 {
  width: 39%;
  right: 9%;
  top: 37%;
  transform: rotate(-14deg);
}

.s3 {
  width: 34%;
  left: 43%;
  bottom: 25%;
  transform: rotate(28deg);
}

.center {
  width: 104px;
  aspect-ratio: 1;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.n1,
.n2,
.n3 {
  width: 58px;
  aspect-ratio: 1;
}

.n1 {
  left: 11%;
  top: 20%;
}

.n2 {
  right: 9%;
  top: 26%;
}

.n3 {
  left: 58%;
  bottom: 4%;
}

.grid {
  display: grid;
  gap: 16px;
}

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

.two-col {
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
}

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

.card {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(252, 254, 255, 0.9));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-width: 0;
  backdrop-filter: blur(8px);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: rgba(20, 124, 114, 0.22);
  box-shadow: 0 24px 54px rgba(24, 32, 42, 0.13);
}

.card h3 {
  font-size: 17px;
  margin-bottom: 12px;
}

.metric {
  display: grid;
  gap: 8px;
  position: relative;
  overflow: hidden;
  border-top: 0;
  padding-top: 20px;
}

.metric::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--teal), var(--cyan));
}

.metric::after {
  content: "";
  position: absolute;
  right: -28px;
  top: -28px;
  width: 92px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(20, 124, 114, 0.08);
}

.metric:nth-child(2)::before {
  background: linear-gradient(90deg, var(--blue), var(--violet));
}

.metric:nth-child(3)::before {
  background: linear-gradient(90deg, var(--amber), #d89a2c);
}

.metric:nth-child(4)::before {
  background: linear-gradient(90deg, var(--green), var(--teal));
}

.metric strong {
  font-size: 26px;
  position: relative;
  z-index: 1;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  border: 1px solid rgba(20, 124, 114, 0.12);
  background: linear-gradient(180deg, #f4fbfa, #edf6f5);
  color: #0d6b62;
  font-size: 12px;
  font-weight: 800;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.toolbar-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.search-box {
  display: grid;
  gap: 5px;
  min-width: min(280px, 100%);
  color: var(--muted);
}

.search-box input {
  min-height: 40px;
  background: #fbfdff;
}

.compact-toolbar {
  padding-top: 14px;
  padding-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  max-height: min(640px, 66vh);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  scrollbar-gutter: stable;
}

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

th,
td {
  padding: 12px;
  border-bottom: 1px solid rgba(217, 226, 236, 0.82);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: linear-gradient(180deg, #f3f8fa, #eaf2f5);
  font-size: 12px;
  color: #43546a;
  text-transform: uppercase;
  letter-spacing: 0;
}

tbody tr:hover {
  background: linear-gradient(90deg, rgba(20, 124, 114, 0.055), rgba(36, 92, 159, 0.035));
}

td.actions {
  display: flex;
  gap: 7px;
}

.select-col {
  width: 44px;
  text-align: center;
}

.select-col input,
.select-all-inline input,
.panel-select input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.select-all-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  color: #43546a;
  font-weight: 700;
}

.bulk-action {
  white-space: nowrap;
}

.panel-select {
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}

.rank-list {
  display: grid;
  gap: 10px;
  max-height: 360px;
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.rank-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 74px;
  gap: 12px;
  align-items: center;
  padding: 11px;
  border: 1px solid rgba(217, 226, 236, 0.92);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--soft-shadow);
  min-width: 520px;
}

.bar {
  height: 10px;
  background: #e7edf4;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}

.network {
  display: grid;
  gap: 16px;
}

.team-tree-wrap {
  overflow: auto;
  max-height: min(720px, 72vh);
  padding: 4px 0 18px;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 124, 114, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(36, 92, 159, 0.03) 1px, transparent 1px),
    #fbfdff;
  background-size: 28px 28px;
  scrollbar-gutter: stable;
}

.team-tree {
  width: max-content;
  min-width: 100%;
  padding: 8px 12px 12px;
}

.team-branch {
  position: relative;
  margin-left: calc(var(--depth) * 34px);
  padding-left: 26px;
}

.team-branch::before {
  content: "";
  position: absolute;
  left: 10px;
  top: -10px;
  bottom: -10px;
  border-left: 1px solid rgba(20, 124, 114, 0.34);
}

.team-branch:first-child::before {
  top: 18px;
}

.team-branch.collapsed::before {
  bottom: calc(100% - 18px);
}

.team-children > .team-branch:last-child::before {
  bottom: calc(100% - 18px);
}

.team-branch .team-row::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 18px;
  width: 16px;
  border-top: 1px solid rgba(20, 124, 114, 0.34);
}

.team-branch.root {
  margin-left: 0;
}

.team-branch.root::before,
.team-branch.root .team-row::before {
  display: none;
}

.team-row {
  position: relative;
  display: grid;
  grid-template-columns: 24px 36px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 560px;
  min-height: 96px;
  padding: 8px 8px 8px 0;
}

.team-row.search-muted {
  opacity: 0.55;
}

.team-row.search-match .team-main {
  border-color: rgba(20, 124, 114, 0.45);
  box-shadow: 0 0 0 3px rgba(20, 124, 114, 0.1);
}

.network-toggle {
  position: relative;
  z-index: 2;
  width: 22px;
  min-height: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(20, 124, 114, 0.34);
  border-radius: 6px;
  background: #f7fbf9;
  color: #147c72;
  font-weight: 800;
  line-height: 1;
  box-shadow: none;
}

.network-toggle:hover {
  background: #e9f7f4;
  transform: translateY(-1px);
}

.network-toggle.empty {
  display: block;
  border: 0;
  background: transparent;
}

.team-avatar {
  width: 34px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 124, 114, 0.95), rgba(36, 92, 159, 0.88)),
    linear-gradient(45deg, rgba(212, 138, 36, 0.52), transparent);
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0;
  box-shadow: 0 10px 22px rgba(20, 124, 114, 0.22);
}

.team-main {
  min-width: 0;
  display: grid;
  gap: 6px;
  padding: 9px;
  border-bottom: 1px solid rgba(20, 124, 114, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 124, 114, 0.06), transparent 22%),
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--soft-shadow);
}

.team-title {
  display: grid;
  gap: 1px;
  line-height: 1.12;
}

.team-title b {
  font-size: 14px;
  text-transform: uppercase;
}

.team-title span,
.team-title strong {
  font-size: 12px;
}

.team-title strong {
  font-weight: 800;
}

.team-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.rank-badge,
.generation-badge,
.activity-badge,
.child-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 800;
}

.rank-badge.member {
  background: #eef5f1;
  color: #23624c;
}

.rank-badge.vip {
  background: #fff4df;
  color: #83530d;
}

.rank-badge.star {
  background: #eaf1fb;
  color: #245c9f;
  border: 1px solid rgba(36, 92, 159, 0.18);
}

.rank-badge.director {
  background: linear-gradient(135deg, #12324a, #147c72 54%, #1f9db1);
  color: #fff;
  border: 1px solid rgba(31, 157, 177, 0.28);
  box-shadow: 0 8px 18px rgba(18, 50, 74, 0.16);
}

.rank-badge.executive {
  background: linear-gradient(135deg, #231f20, #7a4f0f 42%, #d6a13a 72%, #fff1b8);
  color: #fff;
  border: 1px solid rgba(214, 161, 58, 0.42);
  box-shadow: 0 10px 22px rgba(122, 79, 15, 0.2);
}

.rank-text {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 9px;
  background: #eef5f1;
  color: #23624c;
  font-size: 12px;
  font-weight: 900;
}

.rank-text.vip {
  background: #fff4df;
  color: #83530d;
}

.rank-text.star {
  background: #eaf1fb;
  color: #245c9f;
}

.rank-text.director {
  background: #e7f6f5;
  color: #12324a;
  border: 1px solid rgba(20, 124, 114, 0.2);
}

.rank-text.executive {
  background: linear-gradient(135deg, #231f20, #7a4f0f 48%, #d6a13a);
  color: #fff;
  border: 1px solid rgba(214, 161, 58, 0.36);
}

.generation-badge {
  background: #f4f7fb;
  color: #48576a;
  border: 1px solid #d9e2ec;
}

.activity-badge {
  background: #f2f4f7;
  color: #667085;
}

.activity-badge.active {
  background: #e8f7f2;
  color: #147c72;
}

.child-badge {
  background: #fff7e8;
  color: #7a4f0f;
}

.team-metrics {
  display: flex;
  gap: 6px;
  overflow: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  padding-bottom: 2px;
}

.team-metrics span {
  padding: 4px 6px;
  border-radius: 6px;
  background: #f6f9fb;
  border: 1px solid rgba(217, 226, 236, 0.76);
}

.team-metrics span {
  flex: 0 0 auto;
}

.team-metrics b {
  color: #576170;
  font-weight: 700;
}

.team-children {
  position: relative;
}

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

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.mini-metrics span {
  display: grid;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  color: var(--muted);
  font-size: 11px;
}

.mini-metrics b {
  color: var(--ink);
  font-size: 12px;
}

.bonus-grid {
  display: grid;
  gap: 10px;
}

.bonus-card-grid {
  max-height: min(760px, 74vh);
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.bonus-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid rgba(217, 226, 236, 0.78);
}

.bonus-sources {
  margin-top: 12px;
  display: grid;
  gap: 8px;
  max-height: 380px;
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.bonus-sources details {
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--soft-shadow);
}

.bonus-sources summary {
  cursor: pointer;
  font-weight: 800;
}

.bonus-sources summary small {
  color: var(--muted);
  font-weight: 700;
  margin-left: 6px;
}

.source-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--line);
}

.source-row span {
  display: grid;
  gap: 3px;
}

.source-row small,
.bonus-empty {
  color: var(--muted);
}

.announcement-list {
  display: grid;
  gap: 12px;
  max-height: min(680px, 68vh);
  overflow: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
}

.announcement-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(181, 106, 16, 0.055), transparent 28%),
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--soft-shadow);
}

.announcement-item.selectable {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.announcement-item h3,
.placement-card h3 {
  margin-top: 10px;
}

.announcement-item p {
  color: #3a4858;
  line-height: 1.5;
  margin-bottom: 8px;
}

.placement-card {
  border-top: 4px solid var(--amber);
  background: linear-gradient(180deg, #fff, #fffaf0);
}

.placement-structure {
  overflow: visible;
}

.placement-tree-wrap {
  padding-top: 4px;
}

.placement-tree {
  min-width: 100%;
}

.placement-branch::before,
.placement-branch .team-row::before {
  border-color: rgba(36, 92, 159, 0.32);
}

.placement-toggle {
  border-color: rgba(36, 92, 159, 0.34);
  background: #f3f7fc;
  color: var(--blue);
}

.placement-toggle:hover {
  background: #eaf1fb;
}

.placement-avatar {
  background:
    linear-gradient(135deg, rgba(36, 92, 159, 0.96), rgba(20, 124, 114, 0.9)),
    linear-gradient(45deg, rgba(212, 138, 36, 0.42), transparent);
}

.placement-avatar.empty {
  border: 1px dashed rgba(36, 92, 159, 0.38);
  background: #f3f7fc;
  color: var(--blue);
  box-shadow: none;
}

.placement-main {
  background:
    linear-gradient(90deg, rgba(36, 92, 159, 0.06), transparent 26%),
    linear-gradient(180deg, #fff, #fbfdff);
}

.placement-main.empty {
  border: 1px dashed rgba(36, 92, 159, 0.28);
  background: #f8fbff;
  box-shadow: none;
}

.placement-leg-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.placement-mini-leg {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 7px;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
}

.placement-mini-leg span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.placement-mini-leg b {
  font-size: 12px;
}

.placement-mini-leg small {
  color: var(--muted);
  font-size: 10px;
}

.placement-mini-leg.empty {
  border-style: dashed;
  background: #f8fbff;
}

.placement-mini-leg.recommended {
  border-color: rgba(20, 124, 114, 0.45);
  box-shadow: inset 0 0 0 2px rgba(20, 124, 114, 0.08);
}

.placement-empty-branch::before {
  bottom: calc(100% - 18px);
}

.placement-empty-row {
  min-height: 76px;
}

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

.placement-board {
  display: grid;
  gap: 14px;
  border-top: 0;
  overflow: hidden;
}

.placement-board::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--blue), var(--teal));
}

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

.placement-root h3 {
  margin: 9px 0 4px;
}

.placement-signal {
  min-width: 108px;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, #fff8ea, #fff2d5);
  border: 1px solid #f2c36f;
}

.placement-signal b {
  display: block;
  color: var(--amber);
}

.placement-signal span {
  color: #69440b;
  font-size: 12px;
}

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

.placement-leg {
  display: grid;
  gap: 6px;
  min-height: 128px;
  padding: 12px;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.placement-leg span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.placement-leg small {
  color: var(--muted);
}

.placement-leg.empty {
  border-style: dashed;
  background: #f7fbf9;
}

.placement-leg.recommended {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 2px rgba(20, 124, 114, 0.1), 0 12px 24px rgba(20, 124, 114, 0.08);
}

.placement-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
  padding-top: 10px;
  border-top: 1px solid rgba(217, 226, 236, 0.82);
}

.rules-table {
  display: grid;
  gap: 12px;
}

.rule-item {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(20, 124, 114, 0.045), transparent 24%),
    linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--soft-shadow);
}

.rule-item p {
  margin-bottom: 0;
  color: #3a4858;
  line-height: 1.5;
}

.rule-item span {
  color: var(--teal);
  font-weight: 800;
  font-size: 13px;
}

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

.profile-field {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid rgba(217, 226, 236, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #fbfdff);
  box-shadow: var(--soft-shadow);
}

.profile-field span {
  color: var(--muted);
  font-size: 12px;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

dialog {
  border: 0;
  border-radius: 8px;
  padding: 0;
  width: min(720px, calc(100vw - 28px));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

dialog::backdrop {
  background: rgba(13, 23, 29, 0.48);
  backdrop-filter: blur(4px);
}

.dialog-card {
  padding: 20px;
  background:
    linear-gradient(90deg, rgba(20, 124, 114, 0.06), transparent 34%),
    linear-gradient(180deg, #fff, #fbfdff);
}

menu {
  padding: 0;
  margin: 18px 0 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.notice {
  background: linear-gradient(180deg, #fff9ed, #fff3dd);
  border: 1px solid #f2c36f;
  color: #69440b;
  padding: 12px;
  border-radius: 8px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(420px, calc(100vw - 36px));
  padding: 13px 15px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #b42318, #8c2540);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.success {
  background: linear-gradient(135deg, var(--green), var(--teal));
}

.money {
  font-weight: 800;
  color: var(--green);
}

.table-wrap,
.rank-list,
.team-tree-wrap,
.team-metrics,
.source-list,
.bonus-card-grid,
.bonus-sources,
.announcement-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 124, 114, 0.42) rgba(217, 226, 236, 0.58);
}

.table-wrap::-webkit-scrollbar,
.rank-list::-webkit-scrollbar,
.team-tree-wrap::-webkit-scrollbar,
.team-metrics::-webkit-scrollbar,
.source-list::-webkit-scrollbar,
.bonus-card-grid::-webkit-scrollbar,
.bonus-sources::-webkit-scrollbar,
.announcement-list::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.table-wrap::-webkit-scrollbar-track,
.rank-list::-webkit-scrollbar-track,
.team-tree-wrap::-webkit-scrollbar-track,
.team-metrics::-webkit-scrollbar-track,
.source-list::-webkit-scrollbar-track,
.bonus-card-grid::-webkit-scrollbar-track,
.bonus-sources::-webkit-scrollbar-track,
.announcement-list::-webkit-scrollbar-track {
  background: rgba(217, 226, 236, 0.58);
  border-radius: 999px;
}

.table-wrap::-webkit-scrollbar-thumb,
.rank-list::-webkit-scrollbar-thumb,
.team-tree-wrap::-webkit-scrollbar-thumb,
.team-metrics::-webkit-scrollbar-thumb,
.source-list::-webkit-scrollbar-thumb,
.bonus-card-grid::-webkit-scrollbar-thumb,
.bonus-sources::-webkit-scrollbar-thumb,
.announcement-list::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, rgba(20, 124, 114, 0.72), rgba(36, 92, 159, 0.66));
  border: 2px solid rgba(247, 250, 252, 0.95);
  border-radius: 999px;
}

/* Compact operational layout */
body {
  font-size: 14px;
}

.app-shell {
  grid-template-columns: 258px minmax(0, 1fr);
}

.sidebar {
  padding: 16px;
}

.sidebar::before {
  margin: -16px -16px 14px;
}

.brand {
  gap: 10px;
  margin-bottom: 16px;
}

.brand-mark {
  width: 34px;
  font-size: 19px;
}

.login-box {
  gap: 7px;
  padding: 10px;
}

select,
input {
  min-height: 34px;
  padding: 7px 9px;
}

.primary,
.ghost,
.danger,
.icon-btn {
  min-height: 34px;
  padding: 7px 10px;
}

.icon-btn {
  width: 34px;
}

.nav {
  gap: 4px;
  margin-top: 12px;
}

.nav button {
  gap: 8px;
  padding: 8px 9px;
}

.main {
  padding: 18px;
}

.topbar {
  gap: 12px;
  margin-bottom: 14px;
}

h1 {
  font-size: clamp(22px, 2.3vw, 30px);
}

.session-card {
  gap: 8px;
  padding: 8px 9px;
  box-shadow: var(--soft-shadow);
}

.session-card span {
  min-width: min(180px, 100%);
}

.hero-panel {
  grid-template-columns: minmax(0, 1fr) 230px;
  min-height: 132px;
  margin-bottom: 14px;
  padding: 14px 16px;
  background:
    radial-gradient(circle at 84% 28%, rgba(245, 194, 93, 0.27), transparent 23%),
    radial-gradient(circle at 63% 74%, rgba(31, 157, 177, 0.24), transparent 31%),
    radial-gradient(circle at 28% 12%, rgba(126, 167, 223, 0.18), transparent 22%),
    linear-gradient(118deg, rgba(7, 15, 25, 0.99), rgba(12, 45, 57, 0.97) 48%, rgba(37, 31, 56, 0.96)),
    linear-gradient(45deg, rgba(212, 138, 36, 0.42), transparent 42%);
  box-shadow: 0 16px 38px rgba(21, 54, 78, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.hero-panel::before {
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.72) 0 1px, transparent 1.5px) 9px 14px / 54px 44px,
    radial-gradient(circle, rgba(245, 194, 93, 0.56) 0 1px, transparent 1.4px) 28px 22px / 78px 58px,
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 54px 44px, 78px 58px, 42px 42px, 42px 42px;
  opacity: 0.52;
}

.hero-panel::after {
  left: 12px;
  right: 12px;
  height: 3px;
}

.hero-copy {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  align-items: start;
  max-width: none;
}

.hero-copy .eyebrow {
  margin: 0;
  white-space: nowrap;
}

.hero-copy h2 {
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.2;
  margin: 0;
}

.hero-copy > p:not(.eyebrow) {
  display: block;
  max-width: 720px;
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
}

.hero-stats {
  gap: 6px;
  margin-top: 2px;
}

.hero-stats span {
  min-height: 26px;
  padding: 4px 8px;
  font-size: 11px;
}

.hero-visual {
  display: block;
  min-height: 104px;
}

.hero-visual::before {
  content: "";
  position: absolute;
  inset: 7px 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 194, 93, 0.2), transparent 26%),
    radial-gradient(circle at 50% 50%, rgba(31, 157, 177, 0.18), transparent 50%);
  filter: blur(1px);
  opacity: 0.95;
}

.hero-visual .orbit {
  inset: 4px;
  border-color: rgba(255, 255, 255, 0.22);
}

.hero-visual .o2 {
  inset: 24px;
}

.hero-visual .o3 {
  inset: 43px;
}

.hero-visual .orbit::before {
  width: 6px;
  background: #f4c86b;
  box-shadow: 0 0 14px rgba(244, 200, 107, 0.78);
}

.hero-visual .center {
  width: 66px;
  font-size: 11px;
  background: linear-gradient(180deg, #fffaf0, #dff9f5);
  color: #102432;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.2), 0 0 28px rgba(245, 194, 93, 0.24), 0 0 34px rgba(31, 157, 177, 0.2);
}

.hero-visual .n1,
.hero-visual .n2,
.hero-visual .n3 {
  width: 36px;
  font-size: 10px;
  background: linear-gradient(180deg, #ffffff, #eef6ff);
}

.hero-visual .signal {
  height: 2px;
  opacity: 0.7;
}

.grid {
  gap: 10px;
}

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

.two-col {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
}

.three-col {
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
}

.card {
  padding: 12px;
  box-shadow: var(--soft-shadow);
}

.card:hover {
  transform: none;
  box-shadow: var(--soft-shadow);
}

.card h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.metric {
  gap: 4px;
  padding-top: 13px;
}

.metric::before {
  height: 3px;
}

.metric::after {
  width: 64px;
  right: -22px;
  top: -22px;
}

.metric strong {
  font-size: 19px;
  line-height: 1.15;
}

.metric span {
  font-size: 11px;
}

.pill {
  padding: 3px 7px;
  font-size: 11px;
}

.toolbar {
  gap: 8px;
  margin-bottom: 8px;
}

.toolbar-actions {
  gap: 7px;
}

.search-box {
  min-width: min(220px, 100%);
}

.search-box input {
  min-height: 34px;
}

.compact-toolbar {
  padding-top: 10px;
  padding-bottom: 10px;
}

.control-panel .toolbar {
  margin-bottom: 0;
}

.control-panel h3,
.control-panel p {
  margin-bottom: 0;
}

.control-panel .muted {
  margin-top: 3px;
  font-size: 11px;
}

.control-fields {
  align-items: end;
}

.table-wrap {
  max-height: min(720px, 74vh);
}

table {
  min-width: 760px;
  font-size: 13px;
}

th,
td {
  padding: 7px 8px;
}

th {
  font-size: 10px;
}

td.actions {
  gap: 5px;
}

.select-col {
  width: 34px;
}

.select-col input,
.select-all-inline input,
.panel-select input {
  width: 15px;
  height: 15px;
}

.select-all-inline {
  min-height: 34px;
  padding: 0 8px;
}

.rank-list {
  gap: 6px;
  max-height: 430px;
}

.rank-item {
  grid-template-columns: 132px minmax(0, 1fr) 54px;
  gap: 8px;
  padding: 7px;
}

.team-tree-wrap {
  max-height: 74vh;
}

.team-branch {
  margin-left: calc(var(--depth) * 18px);
}

.team-row {
  grid-template-columns: 20px 30px minmax(0, 1fr);
  gap: 6px;
  min-width: 470px;
  min-height: 76px;
  padding: 5px 6px 5px 0;
}

.network-toggle {
  width: 19px;
  min-height: 19px;
  height: 19px;
  border-radius: 5px;
}

.team-avatar {
  width: 29px;
  font-size: 10px;
}

.team-main {
  gap: 4px;
  padding: 7px;
}

.team-title b {
  font-size: 12px;
}

.team-title span,
.team-title strong {
  font-size: 10px;
}

.team-badges {
  gap: 4px;
}

.rank-badge,
.generation-badge,
.activity-badge,
.child-badge {
  min-height: 18px;
  padding: 1px 6px;
  font-size: 9px;
}

.rank-text {
  min-height: 20px;
  padding: 2px 7px;
  font-size: 11px;
}

.team-metrics {
  gap: 4px;
  font-size: 10px;
}

.team-metrics span {
  padding: 3px 5px;
}

.mini-metrics {
  gap: 4px;
  margin-top: 5px;
}

.mini-metrics span {
  padding: 5px;
  font-size: 10px;
}

.mini-metrics b {
  font-size: 11px;
}

.bonus-grid {
  gap: 5px;
}

.bonus-card-grid {
  max-height: min(780px, 76vh);
}

.bonus-row {
  gap: 8px;
  padding: 6px 0;
}

.bonus-sources {
  gap: 6px;
  max-height: 300px;
  margin-top: 8px;
}

.bonus-sources details {
  padding: 7px;
}

.source-list {
  max-height: 260px;
}

.source-row {
  gap: 8px;
  padding: 6px 0;
}

.announcement-list {
  gap: 8px;
}

.announcement-item {
  gap: 10px;
  padding: 10px;
}

.placement-mini-leg {
  min-height: 48px;
  padding: 6px;
}

.placement-map {
  gap: 10px;
}

.placement-board {
  gap: 10px;
}

.placement-root {
  gap: 9px;
}

.placement-signal {
  min-width: 92px;
  padding: 7px;
}

.placement-legs {
  gap: 8px;
}

.placement-leg {
  min-height: 104px;
  padding: 9px;
}

.placement-footer {
  gap: 8px;
  font-size: 12px;
}

.rules-table {
  gap: 8px;
}

.rule-item {
  gap: 4px;
  padding: 9px;
}

.rule-item p {
  line-height: 1.35;
}

.profile-grid,
.form-grid {
  gap: 8px;
}

.profile-field {
  gap: 4px;
  padding: 9px;
}

.dialog-card {
  padding: 14px;
}

.notice {
  padding: 9px;
  margin-bottom: 0;
}

.detail-card {
  display: block;
}

.detail-card > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 28px;
  font-size: 15px;
  font-weight: 900;
}

.detail-card > summary::-webkit-details-marker {
  display: none;
}

.detail-card > summary::after {
  content: "+";
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #eef6f5;
  color: var(--teal);
  font-weight: 900;
}

.detail-card[open] > summary {
  margin-bottom: 10px;
}

.detail-card[open] > summary::after {
  content: "-";
}

@media (max-width: 980px) {
  body {
    background-attachment: scroll;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .hero-panel,
  .two-col,
  .kpi-grid,
  .three-col {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  body {
    overflow-x: hidden;
  }

  .main,
  .sidebar {
    padding: 12px;
  }

  .brand {
    margin-bottom: 12px;
  }

  .login-box {
    gap: 8px;
    padding: 12px;
  }

  select,
  input,
  textarea {
    font-size: 16px;
    min-height: 44px;
    padding: 10px 11px;
  }

  .primary,
  .ghost,
  .danger,
  .icon-btn {
    min-height: 44px;
  }

  .icon-btn {
    width: 44px;
  }

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

  .nav button {
    min-height: 44px;
    padding: 9px;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }

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

  .session-card span {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .session-card,
  .toolbar,
  .toolbar-actions,
  .search-box {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .session-card button,
  .toolbar-actions > button,
  .toolbar-actions > .pill,
  .search-box {
    min-width: 0;
  }

  .control-panel .toolbar {
    gap: 10px;
  }

  .control-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
  }

  .control-fields .search-box:first-child:last-child {
    grid-column: 1 / -1;
  }

  .form-grid,
  .profile-grid,
  .announcement-item {
    grid-template-columns: 1fr;
  }

  .rank-list {
    max-height: 310px;
  }

  .rank-item {
    grid-template-columns: 138px minmax(180px, 1fr) 64px;
    min-width: 460px;
  }

  .table-wrap {
    max-height: 62vh;
    -webkit-overflow-scrolling: touch;
  }

  .team-tree-wrap {
    max-height: 68vh;
    -webkit-overflow-scrolling: touch;
  }

  .team-row {
    min-width: 560px;
  }

  .hero-panel {
    padding: 14px;
    margin-bottom: 12px;
    min-height: 0;
  }

  .hero-copy {
    grid-template-columns: 1fr;
  }

  .hero-copy h2 {
    font-size: 20px;
    line-height: 1.18;
  }

  .hero-copy > p:not(.eyebrow) {
    font-size: 12px;
  }

  .hero-stats {
    justify-content: flex-start;
  }

  .hero-stats span {
    min-height: 30px;
    padding: 5px 8px;
  }

  .placement-map,
  .placement-legs {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    min-height: 112px;
  }

  dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
  }

  .dialog-card {
    max-height: calc(100dvh - 20px);
    overflow: auto;
    padding: 12px;
  }

  menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    max-width: calc(100vw - 20px);
  }
}

/* Premium executive visual layer */
:root {
  --ink: #121a25;
  --muted: #647184;
  --line: #d7e0eb;
  --paper: #eef4f7;
  --panel: #ffffff;
  --teal: #0f766d;
  --amber: #b87a1d;
  --blue: #244f8f;
  --cyan: #1d9ab0;
  --shadow: 0 20px 48px rgba(18, 26, 37, 0.12);
  --soft-shadow: 0 10px 26px rgba(18, 26, 37, 0.085);
}

body {
  background:
    radial-gradient(circle at 13% 9%, rgba(15, 118, 109, 0.16), transparent 27%),
    radial-gradient(circle at 86% 11%, rgba(184, 122, 29, 0.14), transparent 25%),
    radial-gradient(circle at 79% 84%, rgba(36, 79, 143, 0.13), transparent 31%),
    linear-gradient(90deg, rgba(18, 26, 37, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(18, 26, 37, 0.03) 1px, transparent 1px),
    linear-gradient(135deg, #f8fbfd 0%, #eef5f7 47%, #fbf4e8 100%);
  background-size: auto, auto, auto, 34px 34px, 34px 34px, auto;
}

.sidebar {
  background:
    radial-gradient(circle at 28% 3%, rgba(245, 194, 93, 0.18), transparent 24%),
    radial-gradient(circle at 86% 24%, rgba(29, 154, 176, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), transparent 19%),
    linear-gradient(160deg, #08111a 0%, #102833 48%, #161923 100%);
  box-shadow: 18px 0 58px rgba(8, 17, 26, 0.24);
}

.sidebar::before,
.hero-panel::after {
  background: linear-gradient(90deg, #1d9ab0, #f0bd62, #0f766d, #244f8f);
}

.brand-mark {
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.5), transparent 18%),
    linear-gradient(135deg, #0f766d, #1d9ab0 38%, #b87a1d 72%, #244f8f);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28), 0 0 24px rgba(240, 189, 98, 0.16);
}

.login-box,
.session-card,
.card,
.dialog-card,
.table-wrap,
.rank-item,
.team-main,
.placement-main,
.placement-mini-leg,
.announcement-item,
.rule-item,
.profile-field {
  border-color: rgba(194, 205, 219, 0.9);
  box-shadow: var(--soft-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.session-card,
.card,
.dialog-card,
.rank-item,
.team-main,
.placement-main,
.announcement-item,
.rule-item,
.profile-field {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 253, 255, 0.91)),
    linear-gradient(135deg, rgba(15, 118, 109, 0.035), transparent 42%);
}

.topbar h1 {
  color: #101924;
}

.topbar .eyebrow {
  color: #7b5a22;
}

select,
input {
  background: linear-gradient(180deg, #ffffff, #f9fcff);
  border-color: #cfdbe7;
}

select:hover,
input:hover {
  border-color: rgba(15, 118, 109, 0.36);
}

.primary {
  background:
    linear-gradient(135deg, #0f766d, #168f86 48%, #244f8f),
    linear-gradient(45deg, rgba(240, 189, 98, 0.4), transparent);
  box-shadow: 0 12px 22px rgba(15, 118, 109, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ghost {
  background: linear-gradient(180deg, #ffffff, #edf3f8);
  border-color: #ccd8e5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.danger {
  background: linear-gradient(180deg, #fff2f5, #fee2e9);
  border: 1px solid rgba(163, 61, 85, 0.22);
}

.nav button.active,
.nav button:hover {
  background:
    linear-gradient(90deg, rgba(240, 189, 98, 0.16), rgba(255, 255, 255, 0.07)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: inset 3px 0 0 #f0bd62, 0 12px 28px rgba(0, 0, 0, 0.17);
}

.hero-panel {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    radial-gradient(circle at 82% 28%, rgba(240, 189, 98, 0.32), transparent 23%),
    radial-gradient(circle at 66% 76%, rgba(29, 154, 176, 0.28), transparent 31%),
    radial-gradient(circle at 27% 11%, rgba(126, 167, 223, 0.2), transparent 22%),
    linear-gradient(118deg, rgba(5, 12, 22, 0.99), rgba(9, 43, 55, 0.98) 48%, rgba(38, 31, 53, 0.97)),
    linear-gradient(45deg, rgba(184, 122, 29, 0.44), transparent 42%);
  box-shadow: 0 18px 44px rgba(18, 26, 37, 0.23), inset 0 1px 0 rgba(255, 255, 255, 0.13);
}

.hero-stats span {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.metric {
  border: 1px solid rgba(207, 219, 231, 0.82);
  background:
    radial-gradient(circle at 93% 0%, rgba(15, 118, 109, 0.085), transparent 28%),
    linear-gradient(180deg, #ffffff, #f9fcff);
}

.metric::before {
  background: linear-gradient(90deg, #0f766d, #1d9ab0, #f0bd62);
}

.metric:nth-child(2)::before {
  background: linear-gradient(90deg, #244f8f, #1d9ab0);
}

.metric:nth-child(3)::before {
  background: linear-gradient(90deg, #b87a1d, #f0bd62);
}

.metric:nth-child(4)::before {
  background: linear-gradient(90deg, #0f766d, #2f8d5a);
}

.pill,
.rank-text,
.rank-badge,
.generation-badge,
.activity-badge,
.child-badge {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.52);
}

.rank-badge.director,
.rank-text.director {
  background: linear-gradient(135deg, #092b38, #0f766d 48%, #1d9ab0);
  color: #fff;
  border-color: rgba(29, 154, 176, 0.34);
  box-shadow: 0 8px 20px rgba(9, 43, 56, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.rank-badge.executive,
.rank-text.executive {
  background:
    linear-gradient(135deg, #14100d, #6f4611 38%, #d69b35 72%, #fff0ad),
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.42), transparent 18%);
  color: #fff;
  border-color: rgba(214, 155, 53, 0.48);
  box-shadow: 0 10px 24px rgba(111, 70, 17, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.table-wrap {
  background: rgba(255, 255, 255, 0.92);
}

th {
  background: linear-gradient(180deg, #f8fbfd, #eaf2f6);
  color: #35455a;
}

tbody tr:hover {
  background: linear-gradient(90deg, rgba(15, 118, 109, 0.07), rgba(240, 189, 98, 0.045), rgba(36, 79, 143, 0.035));
}

.team-avatar,
.placement-avatar {
  box-shadow: 0 8px 18px rgba(18, 26, 37, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.team-main::before,
.placement-main::before {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.88);
}

.placement-card {
  border-top-color: #f0bd62;
  background:
    linear-gradient(180deg, #fffefb, #fff8ea),
    linear-gradient(135deg, rgba(36, 79, 143, 0.035), transparent);
}

.notice {
  border-color: rgba(184, 122, 29, 0.22);
  background:
    linear-gradient(90deg, rgba(240, 189, 98, 0.12), transparent 46%),
    linear-gradient(180deg, #fffdf8, #fff8ea);
}

.detail-card > summary::after {
  background: linear-gradient(180deg, #eef9f8, #dff1ef);
  color: #0f766d;
}

.primary,
.ghost,
.danger,
.icon-btn,
.card,
.rank-item,
.team-main,
.placement-main,
.announcement-item {
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.primary:hover,
.ghost:hover,
.danger:hover,
.icon-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.025);
}

.card:hover,
.rank-item:hover,
.team-main:hover,
.placement-main:hover,
.announcement-item:hover {
  border-color: rgba(15, 118, 109, 0.24);
  box-shadow: 0 14px 32px rgba(18, 26, 37, 0.105), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.hero-visual .o1 {
  animation: premium-orbit 18s linear infinite;
}

.hero-visual .o2 {
  animation: premium-orbit 24s linear infinite reverse;
}

.hero-visual .o3 {
  animation: premium-orbit 32s linear infinite;
}

.hero-visual .signal {
  animation: premium-signal 3.8s ease-in-out infinite;
}

.hero-visual .s2 {
  animation-delay: 0.7s;
}

.hero-visual .s3 {
  animation-delay: 1.3s;
}

@keyframes premium-orbit {
  to {
    transform: rotate(360deg);
  }
}

@keyframes premium-signal {
  0%,
  100% {
    opacity: 0.46;
  }

  50% {
    opacity: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}

@media (max-width: 620px) {
  .hero-panel {
    box-shadow: 0 14px 32px rgba(18, 26, 37, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.13);
  }

  .session-card,
  .card,
  .dialog-card {
    box-shadow: 0 8px 20px rgba(18, 26, 37, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  }
}
