.tri-leg-mlm-dashboard {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tri-leg-mlm-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.tri-leg-mlm-card {
  border: 1px solid #d4dbe2;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.tri-leg-mlm-card h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #51606f;
}

.tri-leg-mlm-card p {
  margin: 10px 0 0;
  font-size: 24px;
  font-weight: 700;
  color: #0f3f64;
}

.tri-leg-mlm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.tri-leg-mlm-box {
  border: 1px solid #d4dbe2;
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.tri-leg-mlm-box h3,
.tri-leg-mlm-box h4 {
  margin: 0 0 10px;
  color: #1d3f58;
}

.tri-leg-mlm-form,
.tri-leg-mlm-form-inline {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tri-leg-mlm-form-inline {
  flex-direction: row;
  align-items: center;
}

.tri-leg-mlm-form input,
.tri-leg-mlm-form-inline input,
.tri-leg-mlm-box input[type='text'],
.tri-leg-mlm-box input[type='email'],
.tri-leg-mlm-box input[type='password'],
.tri-leg-mlm-box input[type='number'] {
  width: 100%;
  max-width: 100%;
  border: 1px solid #ccd5dd;
  border-radius: 6px;
  padding: 9px 10px;
}

.tri-leg-mlm-form button,
.tri-leg-mlm-form-inline button,
.tri-leg-mlm-box button {
  width: fit-content;
  border: 0;
  border-radius: 6px;
  padding: 9px 14px;
  color: #ffffff;
  background: #1b6ea6;
  cursor: pointer;
}

.tri-leg-mlm-form-inline button {
  white-space: nowrap;
}

.tri-leg-mlm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tri-leg-mlm-table th,
.tri-leg-mlm-table td {
  border: 1px solid #e2e8ef;
  padding: 8px;
  text-align: left;
}

.tri-leg-mlm-table th {
  background: #f2f7fb;
}

.tri-leg-mlm-list {
  margin: 0;
  padding-left: 16px;
}

.tri-leg-mlm-error {
  margin: 10px 0;
  color: #b20838;
  font-weight: 600;
}

.tri-leg-mlm-success {
  margin: 10px 0;
  color: #067647;
  font-weight: 600;
}

.tri-leg-mlm-tree-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tri-leg-mlm-search-results {
  width: 100%;
  font-size: 13px;
  color: #3d4f5f;
}

.tri-leg-mlm-search-results button {
  margin-right: 6px;
  margin-bottom: 6px;
}

.tri-leg-mlm-tree {
  width: 100%;
  min-height: 420px;
  overflow: auto;
  border: 1px solid #dbe3eb;
  border-radius: 8px;
  background: #f6f9fc;
  position: relative;
}

.tri-leg-mlm-tree svg {
  min-width: 800px;
}

@media (max-width: 768px) {
  .tri-leg-mlm-form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .tri-leg-mlm-tree svg {
    min-width: 620px;
  }
}

.tri-leg-mlm-referral-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 6px;
}

.tri-leg-mlm-referral-input {
  margin-bottom: 6px;
}