/* ── Header, tabs & menu ──────────────────────────────── */

/* header: 3-column grid — brand | tabs | account */
.bar {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; padding: 6px 20px; gap: 12px; flex-wrap: nowrap;
}

.brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text);

  & b { font-weight: 400; color: var(--faint); }
}

.acct {
  position: relative; justify-content: flex-end;
  display: flex; align-items: center; gap: 16px;
  font-size: 11px; color: var(--faint); flex-wrap: wrap;

  & .stat { display: inline-flex; align-items: baseline; gap: 4px; }
  & .num { color: var(--muted); }
  & .unit { color: var(--faint); }

  & .user {
    color: var(--muted); background: none; border: 0; font: inherit;
    cursor: pointer; padding: 0;
    text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: var(--dim);
    &:hover { color: var(--text); }
  }

  & #tabAdmin {
    border: 1px solid var(--line); border-radius: 999px;
    padding: 5px 13px; margin-right: 4px;
  }

  & .ghost.is-on {
    color: var(--text); background: var(--panel2);
    &::before { content: none; }
  }
}

.meters { display: flex; align-items: center; gap: 16px; }
.divider { display: none; }

/* GPU badge hidden */
.badge { display: none; }

/* ── credit pill (merged frames + balance) ── */

.credit-pill {
  display: inline-flex; align-items: baseline; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--panel); box-shadow: inset 0 0 0 1px var(--line);
  font-size: 11px; cursor: pointer;

  & .cp-num { color: var(--muted); }
  & .cp-unit { color: var(--faint); }
  & .cp-dot { color: var(--dim); }
}

/* ── tabs (inline in header) ── */

.tabs {
  display: flex; align-items: center; gap: 6px;
  padding: 0; flex-wrap: nowrap;
}

.tab {
  text-transform: uppercase; letter-spacing: .1em; font-size: 11px;
  color: var(--faint); padding: 7px 16px; border-radius: 999px;
  transition: background .12s, color .12s;

  &:hover { color: var(--text); background: var(--panel); }

  &.is-on {
    color: var(--text); background: var(--panel2);
    box-shadow: inset 0 0 0 1px var(--line);
    &::before { content: none; }
  }
}

.tabs-spacer { flex: 1; }

/* farm pulse hidden */
.farmpulse { display: none !important; }

/* Credit tab hidden — reachable via credit pill */
#tabWallet { display: none; }

/* ── header menu ── */

.menubtn {
  display: grid; place-items: center; width: 36px; height: 36px;
  border-radius: 999px; background: var(--panel);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--muted); cursor: pointer; border: 0; padding: 0;

  &:hover, &[aria-expanded="true"] {
    background: var(--panel2); color: var(--text);
  }
}

.menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60;
  min-width: 210px; display: flex; flex-direction: column; padding: 6px;
  background: var(--panel2); border: 1px solid var(--line);
  border-radius: var(--r-card); box-shadow: var(--shadow);

  & .menu-head {
    text-align: left; padding: 10px 12px 8px; color: var(--text);
    font-weight: 600; font-size: 13px;
    border-bottom: 1px solid var(--line); margin-bottom: 6px;
    border-radius: 0; background: none; text-decoration: none;
    display: block !important;
    &:hover { color: var(--acc); }
  }

  & .menu-item {
    text-align: left; background: none; border: 0; border-radius: 8px;
    padding: 9px 12px; font-size: 12.5px; color: var(--muted);
    cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: .02em;

    &:hover { background: var(--panel); color: var(--text); }
    &.is-on { background: var(--panel); color: var(--text); }
    &::before, &::after { content: none; }
  }

  & #logoutBtn {
    color: #ff9a90;
    &:hover { background: rgba(255, 122, 110, .08); color: #ff7a6e; }
  }
}

/* ── responsive ── */

@media (max-width: 700px) {
  #tabWork, #tabFarm, #farmPulse { display: none !important; }
  #gpuStopBtn { display: none !important; }
  .credit-pill .cp-unit:first-of-type,
  .credit-pill .cp-num:first-of-type,
  .credit-pill .cp-dot { display: none; }
}

@media (max-width: 560px) {
  .bar { padding: 12px 14px 8px; gap: 10px; }
  .acct { gap: 12px; }
  .meters { gap: 12px; }
  .acct .user { display: none; }
  .tabs { gap: 4px; }
}
