/* MagicMedia dashboards, trees, and admin layout */
.mm-dashboard,
.mm-admin { max-width: 1440px; margin: 0 auto; }
.mm-admin--frontend { margin-top: 18px; }
.mm-dashboard__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  /* v1.7.89: 18/20px of padding plus a tall avatar made a 3-line masthead.
     12px above and 14px below keeps the bar compact and the avatar, name,
     member ID and actions on one shared centreline. */
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--mm-line-soft);
  margin-bottom: 14px;
  flex-wrap: wrap;
  row-gap: 10px;
}
.mm-dashboard__topbar h1 { font-size: clamp(1.3rem, 2.2vw, 1.7rem); margin: 0 0 2px; line-height: 1.16; }
/* The actions block sits on the same baseline as the identity block, and its
   buttons stop stretching when the bar wraps. */
.mm-dashboard__topbar-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; align-items: center; margin-left: auto; }
.mm-dashboard__topbar-actions .mm-button { min-height: 38px; padding: 8px 14px; }
.mm-dashboard__identity { display: flex; align-items: center; gap: 14px; min-width: 0; }
.mm-dashboard__who { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.mm-dashboard__who h1 { overflow-wrap: anywhere; }
/* Ten tabs: wrap rather than scroll, and align the labels on one centreline. */
.mm-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; border-bottom: 1px solid var(--mm-line-soft); }
.mm-tabs__link { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; }
.mm-tabs__link { flex: 0 0 auto; padding: 11px 15px; color: #b8b8b8; text-decoration: none; border-bottom: 2px solid transparent; font-weight: 700; }
.mm-tabs__link:hover, .mm-tabs__link.is-active { color: var(--mm-gold); border-bottom-color: var(--mm-gold); background: rgba(255,204,74,.05); }
.mm-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.mm-dashboard .mm-card,
.mm-admin .mm-card { margin-bottom: 18px; }
.mm-copy-row { display: flex; gap: 10px; }
.mm-copy-row .mm-input { flex: 1; }
.mm-actions-cell { white-space: nowrap; }
.mm-inline-form { display: inline-flex; gap: 6px; margin: 2px; vertical-align: middle; }
.mm-inline-actions { display: grid; gap: 6px; min-width: 240px; }
.mm-inline-actions .mm-input { min-height: 34px; padding: 6px 8px; font-size: .78rem; }
.mm-inline-actions .mm-button { min-height: 34px; padding: 7px 10px; font-size: .76rem; }
.mm-readonly-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 18px; }
.mm-readonly-grid p { margin: 0; padding: 10px; border: 1px solid var(--mm-line-soft); border-radius: 10px; background: #0d0d0d; font-size: .82rem; }
.mm-readonly-grid strong { display: block; color: #b9bec6; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; }
.mm-edit-vendor hr { border: 0; border-top: 1px solid var(--mm-line-soft); margin: 24px 0; }
.mm-profile-panel { max-width: 900px; }
.mm-filter__label { min-width: min(360px, 100%); }

/* Side-by-side read-only tree views */
.mm-tree-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; margin: 18px 0; }
.mm-tree-panel { min-width: 0; border: 1px solid var(--mm-line); border-radius: 18px; background: #0b0b0b; padding: 16px; box-shadow: 0 12px 34px rgba(0,0,0,.3); }
.mm-tree-panel__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--mm-line-soft); padding-bottom: 12px; margin-bottom: 12px; }
.mm-tree-panel__header h3 { margin: 0; font-size: 1.05rem; }
.mm-tree-badge { padding: 4px 8px; border-radius: 999px; color: var(--mm-gold); border: 1px solid var(--mm-line); font-size: .7rem; font-weight: 800; }
.mm-tree-list { list-style: none; margin: 8px 0 8px 16px; padding: 0 0 0 12px; border-left: 1px dashed rgba(255,204,74,.25); }
.mm-tree-item { margin: 8px 0; }
.mm-tree-node { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: #121212; border: 1px solid var(--mm-line-soft); font-size: .82rem; }
.mm-tree-node--root { background: rgba(255,204,74,.1); border-color: var(--mm-line); color: #fdf8ec; }
.mm-tree-node__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mm-gold); box-shadow: 0 0 0 3px rgba(255,204,74,.12); flex: 0 0 auto; }
.mm-tree-node__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #eee; }
.mm-tree-node__meta { color: var(--mm-gold); font-size: .7rem; white-space: nowrap; }
.mm-tree-income { margin: 4px 0 0 20px; font-size: .7rem; }
.mm-tree-income.is-recorded { color: var(--mm-success); }
.mm-tree-income.is-pending { color: #a3a9b2; }
.mm-tree-empty { color: #777; font-size: .78rem; margin: 8px 0 8px 20px; }
.mm-load-branch { min-height: 30px; padding: 5px 10px; margin: 6px 0 0 20px; font-size: .72rem; }
.mm-tree-branch-loading { color: var(--mm-gold); font-size: .76rem; margin-left: 20px; }

/* Admin table alignment */
.mm-admin .mm-table th,
.mm-admin .mm-table td { vertical-align: top; }
.mm-admin .mm-table img { max-width: 54px; height: auto; border-radius: 7px; }
.mm-admin code, .mm-dashboard code { color: var(--mm-gold); background: #080808; border: 1px solid var(--mm-line-soft); border-radius: 5px; padding: 1px 5px; font-size: .78rem; word-break: break-all; }

@media (max-width: 1100px) {
  .mm-readonly-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .mm-tree-layout, .mm-dashboard-grid { grid-template-columns: 1fr; }
  .mm-dashboard__topbar { align-items: flex-start; flex-direction: column; }
  .mm-dashboard__topbar-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .mm-dashboard__topbar { padding: 12px 0; }
  .mm-tabs__link { padding: 9px 11px; font-size: .84rem; }
  .mm-readonly-grid { grid-template-columns: 1fr; }
  .mm-copy-row { flex-direction: column; }
  .mm-tree-panel { padding: 12px; }
  .mm-tree-list { margin-left: 6px; padding-left: 8px; }
  .mm-inline-form { display: flex; }
}

/* ===== Dashboard pages: tabs, member IDs, upline, tree diagram ========== */
/* Ten tabs need to wrap; scrolling them sideways hides pages. */
.mm-tabs { flex-wrap: wrap; gap: 6px; }
.mm-tabs__link { white-space: nowrap; }

/* Referral-code chip in the dashboard header. Member ID numbers are no longer
   shown anywhere on the member-facing dashboard; the code is what a member can
   act on (share it, quote it to support). The admin screens still show IDs. */
.mm-member-code {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .74rem; font-weight: 700; letter-spacing: .06em;
  color: var(--mm-gold); background: rgba(212, 175, 55, .10);
  border: 1px solid rgba(212, 175, 55, .38);
}

/* Chip class kept for the admin trees, which still identify rows by ID. */
.mm-tree-id {
  display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .02em;
  color: var(--mm-gold); background: rgba(212, 175, 55, .10);
  border: 1px solid rgba(212, 175, 55, .38);
}

/* Overview: your network list */


.mm-split { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 14px; }
@media (max-width: 782px) { .mm-table-fit, .mm-table-fit--half { max-width: 100%; } }
.mm-field--invalid .mm-input { border-color: var(--mm-gold-2); }
.mm-field-error { display: block; margin-top: 6px; color: var(--mm-gold-2); font-size: .82rem; font-weight: 600; }
.mm-bullets { margin: 0 0 12px; padding-left: 20px; color: var(--mm-body); }
.mm-bullets li { margin-bottom: 8px; }
.mm-bullets strong { color: var(--mm-gold-2); }
.mm-network { list-style: none; margin: 0 0 10px; padding: 0; }
.mm-network li {
  display: flex; justify-content: space-between; gap: 14px; align-items: baseline;
  padding: 8px 0; border-bottom: 1px solid var(--mm-line-soft);
}
.mm-network li:last-child { border-bottom: 0; }
.mm-network span { color: var(--mm-muted); font-size: .84rem; }
.mm-network strong { color: var(--mm-white); text-align: right; font-size: .9rem; }

/* Upline list on the Tree view page */
.mm-upline { list-style: none; margin: 8px 0 0; padding: 0; }
.mm-upline li {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 9px 12px; margin-bottom: 6px; border-radius: 10px;
  background: #0d0d0d; border: 1px solid var(--mm-line-soft);
}
.mm-upline__level {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--mm-gold); min-width: 26px;
}
.mm-upline__name { color: var(--mm-white); font-weight: 600; }

/* Tree diagram: connector lines so the nested list reads as a diagram. */
.mm-tree-list { position: relative; margin: 0; padding-left: 18px; list-style: none; }
.mm-tree-list .mm-tree-item { position: relative; padding-left: 16px; }
.mm-tree-list .mm-tree-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0;
  border-left: 1px solid rgba(212, 175, 55, .22);
}
.mm-tree-list .mm-tree-item:last-child::before { bottom: auto; height: 18px; }
.mm-tree-list .mm-tree-item::after {
  content: ""; position: absolute; left: 0; top: 18px; width: 12px;
  border-top: 1px solid rgba(212, 175, 55, .22);
}
.mm-tree-node {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 8px 11px; border-radius: 10px;
  background: #101013; border: 1px solid var(--mm-line-soft);
}
.mm-tree-node:hover { border-color: rgba(212, 175, 55, .45); }
.mm-tree-node__title { color: var(--mm-white); font-weight: 600; }
.mm-tree-node__meta { color: var(--mm-muted); font-size: .76rem; margin-left: auto; }
.mm-tree-node--root { border-color: rgba(212, 175, 55, .5); background: #12110c; }
.mm-tree-node__dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--mm-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .16); flex: 0 0 auto;
}
.mm-tree-income { font-size: .74rem; color: var(--mm-muted); margin: 4px 0 10px 30px; }
.mm-tree-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
@media (max-width: 980px) { .mm-tree-layout { grid-template-columns: minmax(0, 1fr); } }

/* Wide tables on the new pages stay readable */
.mm-table td code { white-space: nowrap; }
@media (max-width: 720px) {
  .mm-network li { flex-direction: column; gap: 2px; }
  .mm-network strong { text-align: left; }
}
